From be1c7e127af9fce006600894df5c5731d99cdc82 Mon Sep 17 00:00:00 2001 From: Peter Lai Date: Fri, 19 Jun 2020 16:07:56 +0000 Subject: [PATCH] Update preflight response status to http.StatusNoContent (204) (#101) --- cors.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cors.go b/cors.go index 8df21d9..e1069cb 100644 --- a/cors.go +++ b/cors.go @@ -211,7 +211,7 @@ func (c *Cors) Handler(h http.Handler) http.Handler { if c.optionPassthrough { h.ServeHTTP(w, r) } else { - w.WriteHeader(http.StatusOK) + w.WriteHeader(http.StatusNoContent) } } else { c.logf("Handler: Actual request") @@ -244,7 +244,7 @@ func (c *Cors) ServeHTTP(w http.ResponseWriter, r *http.Request, next http.Handl if c.optionPassthrough { next(w, r) } else { - w.WriteHeader(http.StatusOK) + w.WriteHeader(http.StatusNoContent) } } else { c.logf("ServeHTTP: Actual request")