This commit is contained in:
bel
2026-06-19 21:26:02 -06:00
parent d1e758cbfa
commit 9189b97277
+2 -2
View File
@@ -41,6 +41,8 @@ func (c Config) ServeHTTP(w http.ResponseWriter, r *http.Request) {
cors(w) cors(w)
if r.Method == http.MethodOptions { if r.Method == http.MethodOptions {
w.Header().Set("Content-Length", "0")
w.Header().Set("Content-Type", "text/plain")
w.WriteHeader(http.StatusOK) w.WriteHeader(http.StatusOK)
return return
} }
@@ -75,8 +77,6 @@ func (c Config) ServeHTTP(w http.ResponseWriter, r *http.Request) {
func cors(w http.ResponseWriter) { func cors(w http.ResponseWriter) {
w.Header().Set("Access-Control-Allow-Origin", "*") w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Headers", "X-Auth-Token, content-type, Content-Type") w.Header().Set("Access-Control-Allow-Headers", "X-Auth-Token, content-type, Content-Type")
w.Header().Set("Content-Length", "0")
w.Header().Set("Content-Type", "text/plain")
w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, OPTIONS, TRACE, PATCH, HEAD, DELETE") w.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, OPTIONS, TRACE, PATCH, HEAD, DELETE")
} }