summaryrefslogtreecommitdiff
path: root/xs_httpd.h
diff options
context:
space:
mode:
authordefault <nobody@localhost>2023-04-20 12:46:59 +0200
committerdefault <nobody@localhost>2023-04-20 12:46:59 +0200
commit11a89ef0f9c8c4e7d1323fc16900755d7d729395 (patch)
tree659c572d6a76bbd8539037dfea6c0bea24bbcbae /xs_httpd.h
parentd55db283902ba81c91ae7842c53d81bd0d7dd6f6 (diff)
Backport from xs.
Diffstat (limited to 'xs_httpd.h')
-rw-r--r--xs_httpd.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/xs_httpd.h b/xs_httpd.h
index e01b660..3eacc5f 100644
--- a/xs_httpd.h
+++ b/xs_httpd.h
@@ -236,12 +236,12 @@ xs_dict *xs_httpd_request(FILE *f, xs_str **payload, int *p_size)
v = xs_dict_get(req, "content-type");
- if (v && strcmp(v, "application/x-www-form-urlencoded") == 0) {
+ if (*payload && v && strcmp(v, "application/x-www-form-urlencoded") == 0) {
xs *upl = xs_url_dec(*payload);
p_vars = xs_url_vars(upl);
}
else
- if (v && xs_startswith(v, "multipart/form-data")) {
+ if (*payload && v && xs_startswith(v, "multipart/form-data")) {
p_vars = _xs_multipart_form_data(*payload, *p_size, v);
}
else