diff options
author | Erlang/OTP <[email protected]> | 2018-06-05 11:57:24 +0200 |
---|---|---|
committer | Erlang/OTP <[email protected]> | 2018-06-05 11:57:24 +0200 |
commit | 0914003ce3bb6cd3ddec112c44c6dd2568658f1b (patch) | |
tree | 27d8472abff8aa4a5e8d6c61c01067094897a655 /lib/inets/src/http_lib/http_request.erl | |
parent | 813157e40027222a1b8f6d0c1df8dbc78bb8f37f (diff) | |
parent | daba7e0abe4a5642543676e966298b08dee83eb9 (diff) | |
download | otp-0914003ce3bb6cd3ddec112c44c6dd2568658f1b.tar.gz otp-0914003ce3bb6cd3ddec112c44c6dd2568658f1b.tar.bz2 otp-0914003ce3bb6cd3ddec112c44c6dd2568658f1b.zip |
Merge branch 'ingela/inets/header-handling/OTP-15092' into maint-20
* ingela/inets/header-handling/OTP-15092:
inets: Gracefully handle bad headers
Diffstat (limited to 'lib/inets/src/http_lib/http_request.erl')
-rw-r--r-- | lib/inets/src/http_lib/http_request.erl | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/inets/src/http_lib/http_request.erl b/lib/inets/src/http_lib/http_request.erl index f68b233e10..8ca1542164 100644 --- a/lib/inets/src/http_lib/http_request.erl +++ b/lib/inets/src/http_lib/http_request.erl @@ -27,10 +27,12 @@ key_value(KeyValueStr) -> case lists:splitwith(fun($:) -> false; (_) -> true end, KeyValueStr) of - {Key, [$: | Value]} -> + {Key, [$: | Value]} when Key =/= [] -> {http_util:to_lower(string:strip(Key)), string:strip(Value)}; {_, []} -> - undefined + undefined; + _ -> + undefined end. %%------------------------------------------------------------------------- %% headers(HeaderList, #http_request_h{}) -> #http_request_h{} |