mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-02-21 17:56:47 +00:00
Fix bug in HTTP server: GET Content-Type
Was incorrectly detecting that a Content-Type header was supplied with a GET request, when in fact none had been supplied
This commit is contained in:
parent
44b27bce57
commit
40698b14e0
@ -927,7 +927,7 @@ static int http_request_start_body(struct http_request *r)
|
||||
DEBUGF("Malformed HTTP %s request: non-zero Content-Length not allowed", r->verb);
|
||||
return 400;
|
||||
}
|
||||
if (r->request_header.content_type.type) {
|
||||
if (r->request_header.content_type.type[0]) {
|
||||
if (r->debug_flag && *r->debug_flag)
|
||||
DEBUGF("Malformed HTTP %s request: Content-Type not allowed", r->verb);
|
||||
return 400;
|
||||
@ -940,7 +940,7 @@ static int http_request_start_body(struct http_request *r)
|
||||
DEBUGF("Malformed HTTP %s request: missing Content-Length header", r->verb);
|
||||
return 411;
|
||||
}
|
||||
if (r->request_header.content_type.type == NULL) {
|
||||
if (r->request_header.content_type.type[0] == '\0') {
|
||||
if (r->debug_flag && *r->debug_flag)
|
||||
DEBUGF("Malformed HTTP %s request: missing Content-Type header", r->verb);
|
||||
return 400;
|
||||
|
Loading…
x
Reference in New Issue
Block a user