aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-03-12 16:19:59 +0100
committerIngela Anderton Andin <[email protected]>2014-02-05 10:32:22 +0100
commit68cecbfa6a9d79b9137c2cf797b0499c9daed27b (patch)
tree35a900b90a32834ddea61bed601568e07b1dff0f /lib/inets/src
parent023a3b53e6011e05f46013104146fcd6df97fd75 (diff)
downloadotp-68cecbfa6a9d79b9137c2cf797b0499c9daed27b.tar.gz
otp-68cecbfa6a9d79b9137c2cf797b0499c9daed27b.tar.bz2
otp-68cecbfa6a9d79b9137c2cf797b0499c9daed27b.zip
Added guard for invalid field and values in headers
Diffstat (limited to 'lib/inets/src')
-rw-r--r--lib/inets/src/http_client/httpc.erl16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/inets/src/http_client/httpc.erl b/lib/inets/src/http_client/httpc.erl
index eb7102d046..fc2081239e 100644
--- a/lib/inets/src/http_client/httpc.erl
+++ b/lib/inets/src/http_client/httpc.erl
@@ -163,8 +163,13 @@ request(Method,
{error, Reason} ->
{error, Reason};
{ok, ParsedUrl} ->
- handle_request(Method, Url, ParsedUrl, Headers, [], [],
- HTTPOptions, Options, Profile)
+ case header_parse(Headers) of
+ {error, Reason} ->
+ {error, Reason};
+ _ ->
+ handle_request(Method, Url, ParsedUrl, Headers, [], [],
+ HTTPOptions, Options, Profile)
+ end
end;
request(Method,
@@ -1247,7 +1252,12 @@ uri_parse(URI, Opts) ->
%%--------------------------------------------------------------------------
-
+header_parse([]) ->
+ ok;
+header_parse([{Field, Value}|T]) when is_list(Field), is_list(Value) ->
+ header_parse(T);
+header_parse(_) ->
+ {error, {headers_error, not_strings}}.
child_name2info(undefined) ->
{error, no_such_service};
child_name2info(httpc_manager) ->