http.c. Limit multipart/form-data to POST

This commit is contained in:
Xavier Del Campo 2023-11-17 14:56:07 +01:00
parent 1755ee663c
commit 1750bbd7ec
Signed by untrusted user: midokura-xavi
GPG Key ID: A9D49AA996C6753A
1 changed files with 6 additions and 0 deletions

6
http.c
View File

@ -940,6 +940,12 @@ static int set_content_type(struct http_ctx *const h, const char *const type)
__func__, (int)n, type);
return 1;
}
else if (h->ctx.op != HTTP_OP_POST)
{
fprintf(stderr, "%s: multipart/form-data only expected for POST\n",
__func__);
return 1;
}
const char *boundary = sep + 1;