mirror of
https://github.com/cesanta/mongoose.git
synced 2024-11-24 02:59:01 +08:00
Merge pull request #2971 from cesanta/411
Fix issuing 411 responses as a client
This commit is contained in:
commit
8ef02aae41
@ -2417,8 +2417,8 @@ static void http_cb(struct mg_connection *c, int ev, void *ev_data) {
|
||||
require_content_len = status >= 200 && status != 204 && status != 304;
|
||||
}
|
||||
if (require_content_len) {
|
||||
mg_http_reply(c, 411, "", "");
|
||||
MG_ERROR(("%s", "Content length missing from request"));
|
||||
if (!c->is_client) mg_http_reply(c, 411, "", "");
|
||||
MG_ERROR(("Content length missing from %s", is_response ? "response" : "request"));
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1059,8 +1059,8 @@ static void http_cb(struct mg_connection *c, int ev, void *ev_data) {
|
||||
require_content_len = status >= 200 && status != 204 && status != 304;
|
||||
}
|
||||
if (require_content_len) {
|
||||
mg_http_reply(c, 411, "", "");
|
||||
MG_ERROR(("%s", "Content length missing from request"));
|
||||
if (!c->is_client) mg_http_reply(c, 411, "", "");
|
||||
MG_ERROR(("Content length missing from %s", is_response ? "response" : "request"));
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user