Let http_populate_post() listen to content-type

This commit is contained in:
Joris Vink 2018-07-03 08:25:06 +02:00
parent 4a8d8ab7f8
commit b5e122419b
1 changed files with 5 additions and 0 deletions

View File

@ -1033,12 +1033,17 @@ http_populate_post(struct http_request *req)
ssize_t ret;
int i, v;
struct kore_buf *body;
const char *content;
char data[BUFSIZ];
char *args[HTTP_MAX_QUERY_ARGS], *val[3], *string;
if (req->method != HTTP_METHOD_POST)
return;
if (!http_request_header(req, "content-type", &content) ||
strcasecmp(content, "application/x-www-form-urlencoded"))
return;
if (req->http_body != NULL) {
body = NULL;
req->http_body->offset = req->content_length;