aboutsummaryrefslogtreecommitdiff
path: root/http.c
diff options
context:
space:
mode:
authorXavier Del Campo <xavier.delcampo@midokura.com>2023-11-17 14:56:07 +0100
committerXavier Del Campo <xavier.delcampo@midokura.com>2023-11-20 16:34:24 +0100
commit1750bbd7ec7277375c0ccd815cd2aed541e7e862 (patch)
tree8d261b186f578eccb81f4bbbe0f1c07892c99e39 /http.c
parent1755ee663cd67cd8d9adf9f06dd82b0477adab76 (diff)
http.c. Limit multipart/form-data to POST
Diffstat (limited to 'http.c')
-rw-r--r--http.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/http.c b/http.c
index 38bb025..2026a8e 100644
--- a/http.c
+++ b/http.c
@@ -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;