mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
http: change error for corrupted requests to 400 Bad Request
Previously it was 413 Request Entity Too Large, which was odd.
This commit is contained in:
parent
f1632e5909
commit
87cdcc1868
5
http.c
5
http.c
@ -1168,8 +1168,11 @@ evhttp_read_body(struct evhttp_connection *evcon, struct evhttp_request *req)
|
||||
evhttp_read_trailer(evcon, req);
|
||||
return;
|
||||
case DATA_CORRUPTED:
|
||||
case DATA_TOO_LONG:
|
||||
/* corrupted data */
|
||||
evhttp_connection_fail_(evcon,
|
||||
EVREQ_HTTP_INVALID_HEADER);
|
||||
return;
|
||||
case DATA_TOO_LONG:
|
||||
evhttp_connection_fail_(evcon,
|
||||
EVREQ_HTTP_DATA_TOO_LONG);
|
||||
return;
|
||||
|
@ -3946,7 +3946,7 @@ http_send_chunk_malformed_test_error_cb(struct bufferevent *bev, short what, voi
|
||||
|
||||
TT_BLATHER(("%s: called\n", __func__));
|
||||
line = evbuffer_readln(input, NULL, EVBUFFER_EOL_CRLF);
|
||||
tt_str_op(line, ==, "HTTP/1.1 413 Request Entity Too Large");
|
||||
tt_str_op(line, ==, "HTTP/1.1 400 Bad Request");
|
||||
|
||||
end:
|
||||
free(line);
|
||||
|
Loading…
x
Reference in New Issue
Block a user