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

Flush response before following redirect #295

Merged
merged 1 commit into from
Jan 15, 2016
Merged

Conversation

ixti
Copy link
Member

@ixti ixti commented Jan 15, 2016

Otherwise redirect following will not work on persistent connections:

HTTP.follow.persistent("https://play.google.com") do |http|
  http.get("https://play.google.com/store/apps/")
end

fails with obvious state error:

HTTP::StateError: Tried to send a request while one is pending already. Make sure you read off the body.
from /home/ixti/.gem/ruby/2.3.0/gems/http-1.0.1/lib/http/connection.rb:63:in `send_request'

Otherwise redirect following will not work on persistent connections
ixti added a commit that referenced this pull request Jan 15, 2016
Flush response before following redirect
@ixti ixti merged commit 4ef2a60 into master Jan 15, 2016
@ixti ixti deleted the fix/redirector-with-persistor branch January 15, 2016 14:34
jsonn pushed a commit to jsonn/pkgsrc that referenced this pull request Feb 14, 2016
Upstream changes (from CHANGES.md):

## 1.0.2 (2016-01-15)

* [#295](httprb/http#295):
  Fix redirect following when used with persistent mode.
  ([@ixti])
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

Successfully merging this pull request may close these issues.

1 participant