Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

open-uri exception: redirection forbidden causes program to exit immediately #4

Open
cmhamill opened this issue Feb 24, 2016 · 0 comments

Comments

@cmhamill
Copy link

Hello,

I just installed semaphore-status via RubyGems a few minutes ago, and after setting my authentication token, I get the following error when running sst:

$ sst
/usr/lib/ruby/2.2.0/open-uri.rb:224:in `open_loop': redirection forbidden: https://semaphoreapp.com/api/v1/projects?auth_token=NOTATOKEN -> http://semaphoreci.com/api/v1/projects?auth_token=NOTATOKEN (RuntimeError)
    from /usr/lib/ruby/2.2.0/open-uri.rb:150:in `open_uri'
    from /usr/lib/ruby/2.2.0/open-uri.rb:716:in `open'
    from /usr/lib/ruby/2.2.0/open-uri.rb:34:in `open'
    from /home/cmh/.gem/ruby/2.2.0/gems/semaphore-status-0.0.2/lib/semaphore-status.rb:14:in `initialize'
    from /home/cmh/.gem/ruby/2.2.0/gems/semaphore-status-0.0.2/bin/sst:64:in `new'
    from /home/cmh/.gem/ruby/2.2.0/gems/semaphore-status-0.0.2/bin/sst:64:in `get_projects'
    from /home/cmh/.gem/ruby/2.2.0/gems/semaphore-status-0.0.2/bin/sst:120:in `<top (required)>'
    from /home/cmh/.gem/ruby/2.2.0/bin/sst:23:in `load'
    from /home/cmh/.gem/ruby/2.2.0/bin/sst:23:in `<main>'

It appears that open-uri does not appreciate the redirect.

Changing the value of SemaphoreClient::API_URL from https://semaphoreapp.com/api/v1/projects?auth_token= to https://semaphoreci.com/api/v1/projects?auth_token= resolves the issue.

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant