Skip to content

Commit

Permalink
fix: allow all origins (close lobehub#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
songquanpeng committed Apr 26, 2023
1 parent 4f8cbd6 commit e7a809b
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions middleware/cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,8 @@ import (
func CORS() gin.HandlerFunc {
config := cors.DefaultConfig()
config.AllowAllOrigins = true
config.AllowCredentials = true
config.AllowMethods = []string{"GET", "POST", "PUT", "DELETE", "OPTIONS"}
config.AllowHeaders = []string{"Origin", "Content-Length", "Content-Type", "Authorization", "Accept", "Connection"}
return cors.New(config)
}

0 comments on commit e7a809b

Please sign in to comment.