cpq 2020-12-24 17:01:49 +00:00
parent 6bcd02bb1c
commit 60e1b64455
2 changed files with 14 additions and 0 deletions

View File

@ -592,6 +592,13 @@ int mg_http_parse(const char *s, size_t len, struct mg_http_message *hm) {
hm->message.len = req_len;
}
// The 204 (No content) responses also have 0 body length
if (hm->body.len == (size_t) ~0 && is_response &&
mg_vcasecmp(&hm->uri, "204") == 0) {
hm->body.len = 0;
hm->message.len = req_len;
}
return req_len;
}

View File

@ -193,6 +193,13 @@ int mg_http_parse(const char *s, size_t len, struct mg_http_message *hm) {
hm->message.len = req_len;
}
// The 204 (No content) responses also have 0 body length
if (hm->body.len == (size_t) ~0 && is_response &&
mg_vcasecmp(&hm->uri, "204") == 0) {
hm->body.len = 0;
hm->message.len = req_len;
}
return req_len;
}