diff options
author | Ingela Anderton Andin <[email protected]> | 2017-10-12 11:55:30 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2017-10-25 10:40:23 +0200 |
commit | 15f71894d82af204eb10589339c3180579e55e20 (patch) | |
tree | 96a5208079ba7cf58907ab7ba5f0374d76d99868 /lib/inets/src/http_server/httpd_request.erl | |
parent | 016c090de0ac94de4c359536d3232555379755ba (diff) | |
download | otp-15f71894d82af204eb10589339c3180579e55e20.tar.gz otp-15f71894d82af204eb10589339c3180579e55e20.tar.bz2 otp-15f71894d82af204eb10589339c3180579e55e20.zip |
inets: httpd - Fix broken handling of POST requests
New chunk mechanism of body data in POST requests added in
5d01c70ca399edf28e99dc760506329689fab6ba
broke handling of POST body data not using the new mechanism.
Added better regression test
Diffstat (limited to 'lib/inets/src/http_server/httpd_request.erl')
-rw-r--r-- | lib/inets/src/http_server/httpd_request.erl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/inets/src/http_server/httpd_request.erl b/lib/inets/src/http_server/httpd_request.erl index 0eaf073255..007d272323 100644 --- a/lib/inets/src/http_server/httpd_request.erl +++ b/lib/inets/src/http_server/httpd_request.erl @@ -306,10 +306,10 @@ add_chunk([<<>>, Body, Length, MaxChunk]) -> add_chunk([More, Body, Length, MaxChunk]) -> body_chunk(<<Body/binary, More/binary>>, Length, MaxChunk). -body_chunk(<<>> = Body, Length, MaxChunk) -> - {ok, {continue, ?MODULE, add_chunk, [Body, Length, MaxChunk]}}; body_chunk(Body, Length, nolimit) -> whole_body(Body, Length); +body_chunk(<<>> = Body, Length, MaxChunk) -> + {ok, {continue, ?MODULE, add_chunk, [Body, Length, MaxChunk]}}; body_chunk(Body, Length, MaxChunk) when Length > MaxChunk -> case size(Body) >= MaxChunk of |