mirror of
https://github.com/espressif/esp-idf.git
synced 2024-10-05 20:47:46 -04:00
feat(http_server): add 413 Payload Too Large response
While not useful for the HTTP parser itself, this is very useful for memory-limited consumers of the HTTP server API. Signed-off-by: Harshit Malpani <harshit.malpani@espressif.com>
This commit is contained in:
parent
3b771d7af2
commit
e40b1402e4
@ -608,6 +608,9 @@ typedef enum {
|
||||
*/
|
||||
HTTPD_411_LENGTH_REQUIRED,
|
||||
|
||||
/* Incoming payload is too large */
|
||||
HTTPD_413_CONTENT_TOO_LARGE,
|
||||
|
||||
/* URI length greater than CONFIG_HTTPD_MAX_URI_LEN */
|
||||
HTTPD_414_URI_TOO_LONG,
|
||||
|
||||
|
@ -432,6 +432,10 @@ esp_err_t httpd_resp_send_err(httpd_req_t *req, httpd_err_code_t error, const ch
|
||||
status = "411 Length Required";
|
||||
msg = "Client must specify Content-Length";
|
||||
break;
|
||||
case HTTPD_413_CONTENT_TOO_LARGE:
|
||||
status = "413 Content Too Large";
|
||||
msg = "Content is too large";
|
||||
break;
|
||||
case HTTPD_431_REQ_HDR_FIELDS_TOO_LARGE:
|
||||
status = "431 Request Header Fields Too Large";
|
||||
msg = "Header fields are too long";
|
||||
|
Loading…
Reference in New Issue
Block a user