aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src/http_client/httpc.erl
diff options
context:
space:
mode:
authorFredrik Gustafsson <[email protected]>2013-03-13 13:47:30 +0100
committerFredrik Gustafsson <[email protected]>2013-03-13 13:47:30 +0100
commit09fa1ba9b2f4becf68912bcfc4692d226344d920 (patch)
tree138126046b1aa797ac50b0cee4d54e15881a6100 /lib/inets/src/http_client/httpc.erl
parent03bc63bed74af4c392d160005b77aca43d4cd4aa (diff)
parent218eee148e1edbe9ea69743525ed31b9272b06af (diff)
downloadotp-09fa1ba9b2f4becf68912bcfc4692d226344d920.tar.gz
otp-09fa1ba9b2f4becf68912bcfc4692d226344d920.tar.bz2
otp-09fa1ba9b2f4becf68912bcfc4692d226344d920.zip
Merge branch 'fredrik/inets/header-error' into maint
* fredrik/inets/header-error: Added guard for invalid field and values in headers
Diffstat (limited to 'lib/inets/src/http_client/httpc.erl')
-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 ede649a5a9..64a60b82aa 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) ->