Browse Source

Improved OPTIONS method.

default 10 months ago
parent
commit
66642bcbcc
1 changed files with 3 additions and 0 deletions
  1. 3 0
      httpd.c

+ 3 - 0
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