Skip to content

Commit 37b25ee

Browse files
committed
Take first response_headers location when replacing host
1 parent adc6a6a commit 37b25ee

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rack/reverse_proxy.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ def proxy(env, source_request, matcher)
7979

8080
# Replace the location header with the proxy domain
8181
if response_headers['location'] && options[:replace_response_host]
82-
response_location = URI(response_headers['location'])
82+
response_location = URI(response_headers['location'][0])
8383
response_location.host = source_request.host
8484
response_headers['location'] = response_location.to_s
8585
end

0 commit comments

Comments
 (0)