diff options
author | Micael Karlberg <[email protected]> | 2011-11-15 11:56:08 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2011-11-15 11:56:08 +0100 |
commit | ff305c1a15e34f1c8d4f923a8f0e532b4e946512 (patch) | |
tree | a2278c08fc60ad4d62e512f350db68981bee496a /lib/inets/src/http_client/httpc_response.erl | |
parent | 45305535f3348d8ea9a637b2236fd079e147971c (diff) | |
parent | da49021ad3323f90c95a65962b6dfff5a7b139f6 (diff) | |
download | otp-ff305c1a15e34f1c8d4f923a8f0e532b4e946512.tar.gz otp-ff305c1a15e34f1c8d4f923a8f0e532b4e946512.tar.bz2 otp-ff305c1a15e34f1c8d4f923a8f0e532b4e946512.zip |
Merge branch 'bmk/inets/inets58_integration'
Diffstat (limited to 'lib/inets/src/http_client/httpc_response.erl')
-rw-r--r-- | lib/inets/src/http_client/httpc_response.erl | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/inets/src/http_client/httpc_response.erl b/lib/inets/src/http_client/httpc_response.erl index 207b96271c..2414ed0911 100644 --- a/lib/inets/src/http_client/httpc_response.erl +++ b/lib/inets/src/http_client/httpc_response.erl @@ -340,7 +340,9 @@ redirect(Response = {StatusLine, Headers, Body}, Request) -> undefined -> transparent(Response, Request); RedirUrl -> - case http_uri:parse(RedirUrl) of + UrlParseOpts = [{ipv6_host_with_brackets, + Request#request.ipv6_host_with_brackets}], + case http_uri:parse(RedirUrl, UrlParseOpts) of {error, no_scheme} when (Request#request.settings)#http_options.relaxed -> NewLocation = fix_relative_uri(Request, RedirUrl), @@ -350,10 +352,9 @@ redirect(Response = {StatusLine, Headers, Body}, Request) -> {error, Reason} -> {ok, error(Request, Reason), Data}; %% Automatic redirection - {Scheme, _, Host, Port, Path, Query} -> + {ok, {Scheme, _, Host, Port, Path, Query}} -> NewHeaders = - (Request#request.headers)#http_request_h{host = - Host}, + (Request#request.headers)#http_request_h{host = Host}, NewRequest = Request#request{redircount = Request#request.redircount+1, |