diff options
author | Ingela Anderton Andin <[email protected]> | 2014-05-16 14:46:13 +0200 |
---|---|---|
committer | Ingela Anderton Andin <[email protected]> | 2014-05-23 16:33:50 +0200 |
commit | ee3fd715255a865b80532ad1cf88e51a8a4147ba (patch) | |
tree | f1aebf9ee99cdb3cc81e7fb47def0216c4a3fd72 /lib/inets/src/http_server/httpd_request_handler.erl | |
parent | bf352a0d19499f9041cb887ce83c1c13b9def759 (diff) | |
download | otp-ee3fd715255a865b80532ad1cf88e51a8a4147ba.tar.gz otp-ee3fd715255a865b80532ad1cf88e51a8a4147ba.tar.bz2 otp-ee3fd715255a865b80532ad1cf88e51a8a4147ba.zip |
inets: httpd - Behave well on not so long but wrong request lines
Diffstat (limited to 'lib/inets/src/http_server/httpd_request_handler.erl')
-rw-r--r-- | lib/inets/src/http_server/httpd_request_handler.erl | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lib/inets/src/http_server/httpd_request_handler.erl b/lib/inets/src/http_server/httpd_request_handler.erl index 8dcfec570a..b3c9cbc46a 100644 --- a/lib/inets/src/http_server/httpd_request_handler.erl +++ b/lib/inets/src/http_server/httpd_request_handler.erl @@ -375,6 +375,11 @@ handle_http_msg({Method, Uri, Version, {RecordHeaders, Headers}, Body}, 400, URI), Reason = io_lib:format("Malformed syntax in URI: ~p~n", [URI]), error_log(Reason, ModData), + {stop, normal, State#state{response_sent = true}}; + {error, {bad_version, Ver}} -> + httpd_response:send_status(ModData#mod{http_version = "HTTP/0.9"}, 400, Ver), + Reason = io_lib:format("Malformed syntax version: ~p~n", [Ver]), + error_log(Reason, ModData), {stop, normal, State#state{response_sent = true}} end; handle_http_msg({ChunkedHeaders, Body}, |