From 66642bcbccdce3249e553e5b70627b508c76b127 Mon Sep 17 00:00:00 2001 From: default Date: Fri, 31 May 2024 18:34:50 +0200 Subject: Improved OPTIONS method. --- httpd.c | 3 +++ 1 file changed, 3 insertions(+) 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 -- cgit v1.2.3