Fixed the wrong buffer check.

This commit is contained in:
Jose Marcial Vieira Bisneto 2017-09-25 09:34:54 -03:00
parent 9402f31841
commit b4e3817d62
No known key found for this signature in database
GPG key ID: 103E935E7E6E831E

View file

@ -480,7 +480,7 @@ void *api_connection_thread (void *ptr)
// once we leave the building of the req struct, do we need to do more? This flag will tell us.
int further_processing_necessary = 0;
if (strncmp(buf + req.method, "GET", 3)==0) {
if (strncmp(req.buf + req.method, "GET", 3)==0) {
if (strcmp (req.buf + req.path, "/")==0 ||
strcmp (req.buf + req.path, "/webui")==0 ||
strcmp (req.buf + req.path, "/webui/")==0) {
@ -504,7 +504,7 @@ void *api_connection_thread (void *ptr)
// move out of the if to do further processing
}
// end of GET
} else if (strncmp(buf + req.method, "POST", 4)==0) {
} else if (strncmp(req.buf + req.method, "POST", 4)==0) {
// TODO: Handle gzip/json POST requests.
p = header_value_cmp(&req, "Content-Type:", "multipart/form-data;");