diff options
author | Micael Karlberg <[email protected]> | 2012-03-21 11:17:19 +0100 |
---|---|---|
committer | Micael Karlberg <[email protected]> | 2012-03-21 11:17:19 +0100 |
commit | afe7a29a54a7958ac90e44b3bee6c572792bb96b (patch) | |
tree | 26b4fee366cbf508055809c557ea65acaf071caa /lib/inets/src/http_client/httpc_response.erl | |
parent | f65b43b80884ec86db328bdcc06109536116e211 (diff) | |
parent | 85fded451253d400e02040c0db9ca6915075f89f (diff) | |
download | otp-afe7a29a54a7958ac90e44b3bee6c572792bb96b.tar.gz otp-afe7a29a54a7958ac90e44b3bee6c572792bb96b.tar.bz2 otp-afe7a29a54a7958ac90e44b3bee6c572792bb96b.zip |
Merge branch 'bmk/inets/inets59_integration2' into maint
Diffstat (limited to 'lib/inets/src/http_client/httpc_response.erl')
-rw-r--r-- | lib/inets/src/http_client/httpc_response.erl | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/inets/src/http_client/httpc_response.erl b/lib/inets/src/http_client/httpc_response.erl index 919115a23a..23924e355e 100644 --- a/lib/inets/src/http_client/httpc_response.erl +++ b/lib/inets/src/http_client/httpc_response.erl @@ -342,7 +342,7 @@ redirect(Response = {StatusLine, Headers, Body}, Request) -> RedirUrl -> UrlParseOpts = [{ipv6_host_with_brackets, Request#request.ipv6_host_with_brackets}], - case http_uri:parse(RedirUrl, UrlParseOpts) of + case uri_parse(RedirUrl, UrlParseOpts) of {error, no_scheme} when (Request#request.settings)#http_options.relaxed -> NewLocation = fix_relative_uri(Request, RedirUrl), @@ -437,3 +437,17 @@ format_response({StatusLine, Headers, Body}) -> end, {{StatusLine, http_response:header_list(Headers), NewBody}, Data}. +%%-------------------------------------------------------------------------- +%% These functions is just simple wrappers to parse specifically HTTP URIs +%%-------------------------------------------------------------------------- + +scheme_defaults() -> + [{http, 80}, {https, 443}]. + +uri_parse(URI, Opts) -> + http_uri:parse(URI, [{scheme_defaults, scheme_defaults()} | Opts]). + + +%%-------------------------------------------------------------------------- + + |