summaryrefslogtreecommitdiff
path: root/httpd.c
diff options
context:
space:
mode:
authordefault <nobody@localhost>2024-05-31 18:34:50 +0200
committerdefault <nobody@localhost>2024-05-31 18:34:50 +0200
commit66642bcbccdce3249e553e5b70627b508c76b127 (patch)
treef10ada281daee4ce10c732690db8b33ed1fc73e9 /httpd.c
parent763ddae42f248a6d9140dcfe20fabe7b52efdbce (diff)
Improved OPTIONS method.
Diffstat (limited to 'httpd.c')
-rw-r--r--httpd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/httpd.c b/httpd.c
index d566b1e..81e520f 100644
--- a/httpd.c
+++ b/httpd.c
@@ -373,6 +373,9 @@ void httpd_connection(FILE *f)
}
else
if (strcmp(method, "OPTIONS") == 0) {
+ const char *methods = "OPTIONS, GET, HEAD, POST, PUT, DELETE";
+ headers = xs_dict_append(headers, "allow", methods);
+ headers = xs_dict_append(headers, "access-control-allow-methods", methods);
status = HTTP_STATUS_OK;
}
else