aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_client/httpc.erl
diff options
context:
space:
mode:
authorMicael Karlberg <[email protected]>2010-04-28 15:36:55 +0000
committerErlang/OTP <[email protected]>2010-04-28 15:36:55 +0000
commit4b87b22ce97abf2759eb551222a862e17c5f4dcb (patch)
treea7f1bace0e899f471f0b43e946cb4a2e10495918 /lib/inets/src/http_client/httpc.erl
parent98226b13ccabb8e968b33a649aa175a7c48b0d3b (diff)
downloadotp-4b87b22ce97abf2759eb551222a862e17c5f4dcb.tar.gz
otp-4b87b22ce97abf2759eb551222a862e17c5f4dcb.tar.bz2
otp-4b87b22ce97abf2759eb551222a862e17c5f4dcb.zip
OTP-8542: HTTP client memory leak
OTP-8607: https default port not handled
Diffstat (limited to 'lib/inets/src/http_client/httpc.erl')
-rw-r--r--lib/inets/src/http_client/httpc.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl
index 5205605e0a..6deeab6948 100644
--- a/lib/inets/src/http_client/httpc.erl
+++ b/lib/inets/src/http_client/httpc.erl
@@ -432,7 +432,7 @@ handle_request(Method, Url,
Options = request_options(Options0),
Sync = proplists:get_value(sync, Options),
Stream = proplists:get_value(stream, Options),
- Host2 = header_host(Host, Port),
+ Host2 = header_host(Scheme, Host, Port),
HeadersRecord = header_record(NewHeaders, Host2, HTTPOptions),
Receiver = proplists:get_value(receiver, Options),
SocketOpts = proplists:get_value(socket_opts, Options),
@@ -895,9 +895,11 @@ bad_option(Option, BadValue) ->
throw({error, {bad_option, Option, BadValue}}).
-header_host(Host, 80 = _Port) ->
+header_host(https, Host, 443 = _Port) ->
Host;
-header_host(Host, Port) ->
+header_host(http, Host, 80 = _Port) ->
+ Host;
+header_host(_Scheme, Host, Port) ->
Host ++ ":" ++ integer_to_list(Port).