CORS. Add support for OPTIONS requests.

This commit is contained in:
MPTres
2023-12-04 17:14:18 +01:00
parent eceb4a476f
commit 84469dcd25
2 changed files with 6 additions and 1 deletions
+3
View File
@@ -49,6 +49,9 @@ func syncHandler(w http.ResponseWriter, r *http.Request) {
http.Error(w, "", http.StatusBadRequest)
}
case "OPTIONS":
w.WriteHeader(http.StatusNoContent)
default:
http.Error(w, "", http.StatusMethodNotAllowed)
}