mirror of
https://github.com/cesanta/mongoose.git
synced 2026-11-23 20:11:49 +00:00
Merge pull request #2971 from cesanta/411
Fix issuing 411 responses as a client
This commit is contained in:
2 files changed
+4
-4
No files matched your search
+2
-2
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+2
-2
@@ -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"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user