diff options
author | Fredrik Gustafsson <[email protected]> | 2013-03-12 16:19:59 +0100 |
---|---|---|
committer | Fredrik Gustafsson <[email protected]> | 2013-03-12 16:19:59 +0100 |
commit | 218eee148e1edbe9ea69743525ed31b9272b06af (patch) | |
tree | 577863dc7feeed39d62f364ab25aa33b14efcac5 /lib/inets/src | |
parent | bec7094e6b238774997bcb12f308f7f5bfadf160 (diff) | |
download | otp-218eee148e1edbe9ea69743525ed31b9272b06af.tar.gz otp-218eee148e1edbe9ea69743525ed31b9272b06af.tar.bz2 otp-218eee148e1edbe9ea69743525ed31b9272b06af.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.erl | 16 |
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) -> |