diff options
author | John Högberg <[email protected]> | 2018-06-05 14:05:38 +0200 |
---|---|---|
committer | John Högberg <[email protected]> | 2018-06-05 14:05:38 +0200 |
commit | 5cb944bf32b7b3f4ec5500710fe10c28a643e1fd (patch) | |
tree | 817ed501c02aeda7cdc03725a6d4325a7f5741b0 /lib/inets/src/http_lib/http_request.erl | |
parent | bbb3d151e6329d58b34e526fefb6964677d93104 (diff) | |
parent | cfaede58328ace4bb4fb7c5e1b055e420c0ded9a (diff) | |
download | otp-5cb944bf32b7b3f4ec5500710fe10c28a643e1fd.tar.gz otp-5cb944bf32b7b3f4ec5500710fe10c28a643e1fd.tar.bz2 otp-5cb944bf32b7b3f4ec5500710fe10c28a643e1fd.zip |
Merge branch 'maint-20' into maint
* maint-20:
Updated OTP version
Prepare release
inets: Gracefully handle bad headers
[erl_docgen] Update version
[erl_docgen] Add missing file db_funcs.xsl to file list
erts: Fix bug in system_profile
erts: Fix bug in enif_binary_to_term for immediates
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{} |