Skip to content

Commit

Permalink
allow Authorization header in CORS
Browse files Browse the repository at this point in the history
  • Loading branch information
d-led committed Nov 13, 2020
1 parent 101f587 commit b64d466
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -254,8 +254,8 @@ func (s *Server) setUpCORS() {
if s.options.CORSOrigins != nil && len(s.options.CORSOrigins) > 0 {
corsConfig := cors.DefaultConfig()
corsConfig.AllowOrigins = s.options.CORSOrigins
corsConfig.AllowMethods = []string{"POST", "GET"}
corsConfig.AllowHeaders = []string{"last-event-id"}
corsConfig.AllowMethods = []string{"POST", "GET", "OPTIONS"}
corsConfig.AllowHeaders = []string{"last-event-id", "Authorization"}
corsConfig.AllowCredentials = true
log.Printf("Using CORS headers: %v", corsConfig.AllowOrigins)
s.server.Use(cors.New(corsConfig))
Expand Down

0 comments on commit b64d466

Please sign in to comment.