Compare commits

...

2 Commits

Author SHA1 Message Date
bel
d1e758cbfa always cors 2026-06-19 21:19:57 -06:00
bel
2d0dcb67b2 ignore bin 2026-05-31 10:30:19 -06:00
2 changed files with 3 additions and 2 deletions

1
.gitignore vendored Normal file
View File

@@ -0,0 +1 @@
/exec-*

View File

@@ -39,8 +39,9 @@ func (c Config) ServeHTTP(w http.ResponseWriter, r *http.Request) {
return return
} }
if r.Method == http.MethodOptions {
cors(w) cors(w)
if r.Method == http.MethodOptions {
w.WriteHeader(http.StatusOK)
return return
} }
@@ -77,7 +78,6 @@ func cors(w http.ResponseWriter) {
w.Header().Set("Content-Length", "0") w.Header().Set("Content-Length", "0")
w.Header().Set("Content-Type", "text/plain") 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")
w.WriteHeader(http.StatusOK)
} }
func (c Config) key(r *http.Request) string { func (c Config) key(r *http.Request) string {