Skip to content

Commit

Permalink
remove CORS Origins
Browse files Browse the repository at this point in the history
  • Loading branch information
m-mattia-m committed Nov 23, 2023
1 parent c291941 commit 33aed59
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions internal/api/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,7 @@ func Router(svc service.Service) *gin.Engine {
r.RedirectTrailingSlash = false

corsPolicy := cors.DefaultConfig()
corsPolicy.AllowOrigins = []string{
viper.GetString("frontend.url"),
fmt.Sprintf("%s://%s:%s", viper.GetString("server.scheme"), viper.GetString("server.domain"), viper.GetString("server.port")),
}
corsPolicy.AllowOrigins = []string{"*"}
corsPolicy.AllowHeaders = append(corsPolicy.AllowHeaders, "Authorization")

r.Use(cors.New(corsPolicy))
Expand Down

0 comments on commit 33aed59

Please sign in to comment.