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

Solving "Open uri redirect forbidden" for http request #1

merged 4 commits into from Jan 5, 2016


None yet
2 participants

khaled0fares commented Jan 5, 2016

I've noticed that you used (http) protocol instead of (https) when sending get request to Wikipedia.
Using http protocol causes open_uri redirect forbidden error.

The solution is to add open_uri_rallow_redirect gem which is built on top of open_uri.

what i committed:
1- Adding open_uri_allow_redirect as a run time dependency
2- In file lib/askwiki.rb i changed open_uri to open_uri_allow_redirect and added OpenURI.allow_redirect which is a module method that takes a block(your open method wrapped in that block :) )
3- Removing my Rakefile which i created just to install the gem locally and make sure it worked and it did .

emad-elsaid pushed a commit that referenced this pull request Jan 5, 2016

Emad Elsaid
Merge pull request #1 from khaledmohammedfares/master
Solving "Open uri redirect forbidden" for http request

@emad-elsaid emad-elsaid merged commit 7ac7c21 into emad-elsaid:master Jan 5, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment