diff --git a/internal/pkg/middleware/cors.go b/internal/pkg/middleware/cors.go index b4487e7..5c793a6 100644 --- a/internal/pkg/middleware/cors.go +++ b/internal/pkg/middleware/cors.go @@ -19,6 +19,11 @@ func (c *CORSMiddleware) CorsMiddleware(next http.Handler) http.Handler { if len(c.AllowedOrigins) > 0 { w.Header().Set("Access-Control-Allow-Origin", c.AllowedOrigins[0]) } + if r.Method == http.MethodOptions { + w.WriteHeader(http.StatusOK) + return + } + next.ServeHTTP(w, r) }, ) }