aboutsummaryrefslogtreecommitdiffstats
path: root/lib/inets/src
diff options
context:
space:
mode:
authorJohannes Weißl <[email protected]>2015-11-14 19:30:52 +0100
committerJohannes Weißl <[email protected]>2015-11-15 09:09:18 +0100
commit56025e23118f69b8d1b87b0478a93499752360cb (patch)
tree9bc40a6c81660dd92f1304cc61846a3a346f7964 /lib/inets/src
parent0db6272323fd662cb43f5bb4d24f01daa8a6647d (diff)
downloadotp-56025e23118f69b8d1b87b0478a93499752360cb.tar.gz
otp-56025e23118f69b8d1b87b0478a93499752360cb.tar.bz2
otp-56025e23118f69b8d1b87b0478a93499752360cb.zip
inets: Allow whitespace after HTTP chunk again
Before 77acb47 http:request/1 could parse server responses with whitespace after the HTTP chunk size (some embedded legacy devices still do this). This patch restores this functionality.
Diffstat (limited to 'lib/inets/src')
-rw-r--r--lib/inets/src/http_lib/http_chunk.erl2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/inets/src/http_lib/http_chunk.erl b/lib/inets/src/http_lib/http_chunk.erl
index 2f8476a49d..9699856bf8 100644
--- a/lib/inets/src/http_lib/http_chunk.erl
+++ b/lib/inets/src/http_lib/http_chunk.erl
@@ -147,7 +147,7 @@ decode_size(Data = <<?CR, ?LF, ChunkRest/binary>>, HexList, AccHeaderSize,
{MaxBodySize, Body,
AccLength,
MaxHeaderSize}) ->
- try http_util:hexlist_to_integer(lists:reverse(HexList)) of
+ try http_util:hexlist_to_integer(lists:reverse(string:strip(HexList, left))) of
0 -> % Last chunk, there was no data
ignore_extensions(Data, remaing_size(MaxHeaderSize, AccHeaderSize), MaxHeaderSize,
{?MODULE, decode_trailer,