snac2

Fork of https://codeberg.org/grunfink/snac2
git clone https://git.inz.fi/snac2
Log | Files | Refs | README | LICENSE

commit 66642bcbccdce3249e553e5b70627b508c76b127
parent 763ddae42f248a6d9140dcfe20fabe7b52efdbce
Author: default <nobody@localhost>
Date:   Fri, 31 May 2024 18:34:50 +0200

Improved OPTIONS method.

Diffstat:
Mhttpd.c | 3+++
1 file changed, 3 insertions(+), 0 deletions(-)

diff --git 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