diff --git a/internal/middleware/cros/cros.go b/internal/middleware/cros/cros.go index 3d74e93..477180a 100644 --- a/internal/middleware/cros/cros.go +++ b/internal/middleware/cros/cros.go @@ -1,6 +1,8 @@ package cros import ( + "net/http" + "github.com/gin-gonic/gin" ) @@ -21,6 +23,12 @@ func CorsByRules(whiteList []string) gin.HandlerFunc { break } } + + if c.Request.Method == "OPTIONS" { + c.JSON(http.StatusOK, "Options Request!") + return + } + c.Next() } }