Skip to content

Commit

Permalink
Take first response_headers location when replacing host
Browse files Browse the repository at this point in the history
  • Loading branch information
pex committed Sep 15, 2014
1 parent adc6a6a commit 37b25ee
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rack/reverse_proxy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def proxy(env, source_request, matcher)

# Replace the location header with the proxy domain
if response_headers['location'] && options[:replace_response_host]
response_location = URI(response_headers['location'])
response_location = URI(response_headers['location'][0])
response_location.host = source_request.host
response_headers['location'] = response_location.to_s
end
Expand Down

0 comments on commit 37b25ee

Please sign in to comment.