From 9189b9727781b10f5716e8e4769f48dc249c5a48 Mon Sep 17 00:00:00 2001 From: bel Date: Fri, 19 Jun 2026 21:26:02 -0600 Subject: [PATCH] oop --- main.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/main.go b/main.go index 0410be5..19f9d14 100644 --- a/main.go +++ b/main.go @@ -41,6 +41,8 @@ func (c Config) ServeHTTP(w http.ResponseWriter, r *http.Request) { cors(w) if r.Method == http.MethodOptions { + w.Header().Set("Content-Length", "0") + w.Header().Set("Content-Type", "text/plain") w.WriteHeader(http.StatusOK) return } @@ -75,8 +77,6 @@ func (c Config) ServeHTTP(w http.ResponseWriter, r *http.Request) { func cors(w http.ResponseWriter) { w.Header().Set("Access-Control-Allow-Origin", "*") 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") }