Skip to content

Commit

Permalink
fix: astericks in origin when present
Browse files Browse the repository at this point in the history
  • Loading branch information
OnlyNico43 committed Oct 31, 2024
1 parent 6e539b4 commit 7679ce4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ func CorsMiddleware(config Config) gin.HandlerFunc {
c.AbortWithStatus(http.StatusForbidden)
}

if slices.Contains(config.AllowedOrigins, "*") {
currentOrigin = "*"
}

preflight := strings.ToUpper(c.Request.Method) == "OPTIONS"
if preflight {
// Headers for preflight requests
Expand Down

0 comments on commit 7679ce4

Please sign in to comment.