Skip to content
This repository has been archived by the owner on Feb 9, 2025. It is now read-only.

Commit

Permalink
chore: updated CORS config
Browse files Browse the repository at this point in the history
  • Loading branch information
Goldziher committed Nov 27, 2023
1 parent b3c10c0 commit d5ea5d3
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions shared/go/router/router.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,12 @@ func New(opts Options) chi.Router {
if opts.Environment != "test" {
router.Use(chimiddleware.RealIP)
router.Use(cors.Handler(cors.Options{
AllowedOrigins: []string{"*"},
AllowedMethods: []string{"GET", "POST", "PATCH", "DELETE", "OPTIONS"},
AllowedHeaders: []string{"*"},
MaxAge: 3600,
Debug: opts.Environment == "development",
AllowCredentials: true,
AllowedHeaders: []string{"X-Request-Id", "Authorization", "Content-Type", "Accept"},
AllowedMethods: []string{"GET", "POST", "PATCH", "DELETE", "OPTIONS"},
AllowedOrigins: []string{"https://*", "http://*"},
Debug: opts.Environment == "development",
MaxAge: 3600,
}))
router.Use(httplog.RequestLogger(log.With().Str("service", opts.ServiceName).Logger()))
router.Use(chimiddleware.Heartbeat("/health-check"))
Expand Down

0 comments on commit d5ea5d3

Please sign in to comment.