mirror of
https://github.com/cesanta/mongoose.git
synced 2026-10-30 12:50:58 +00:00
Fix #1292 - allow requests with missing protocol version, responses with no reason fields
This commit is contained in:
1 parent
e69de57def
commit
886a29d659
3 files changed
+11
-5
No files matched your search
+2
-2
@@ -209,8 +209,8 @@ int mg_http_parse(const char *s, size_t len, struct mg_http_message *hm) {
|
||||
s = skip(s, end, " ", &hm->uri);
|
||||
s = skip(s, end, "\r\n", &hm->proto);
|
||||
|
||||
// Sanity check
|
||||
if (hm->method.len == 0 || hm->uri.len == 0 || hm->proto.len == 0) return -1;
|
||||
// Sanity check. Allow protocol/reason to be empty
|
||||
if (hm->method.len == 0 || hm->uri.len == 0) return -1;
|
||||
|
||||
// If URI contains '?' character, setup query string
|
||||
if ((qs = (const char *) memchr(hm->uri.ptr, '?', hm->uri.len)) != NULL) {
|
||||
|
||||
Reference in new issue
Block a user