Skip to content

Commit

Permalink
Flush response before following redirect
Browse files Browse the repository at this point in the history
Otherwise redirect following will not work on persistent connections
  • Loading branch information
ixti committed Jan 15, 2016
1 parent d278878 commit 6e4cc86
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/http/redirector.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ def perform(request, response)
fail TooManyRedirectsError if too_many_hops?
fail EndlessRedirectError if endless_loop?

@response.flush

@request = redirect_to @response.headers[Headers::LOCATION]
@response = yield @request
end
Expand Down

0 comments on commit 6e4cc86

Please sign in to comment.