Skip to content

Commit

Permalink
fix: cros (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tohrusky authored Sep 23, 2024
1 parent ab5f5a1 commit fb98ddf
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions internal/middleware/cros/cros.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package cros

import (
"net/http"

"github.com/gin-gonic/gin"
)

Expand All @@ -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()
}
}

0 comments on commit fb98ddf

Please sign in to comment.