Skip to content

Commit

Permalink
fix: Support preflight of auth libraries in js
Browse files Browse the repository at this point in the history
  • Loading branch information
GhiaC authored and johanbrandhorst committed Jul 22, 2019
1 parent 899b614 commit c234fc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/gateway/handlers.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ func allowCORS(h http.Handler) http.Handler {
// CORS from any origin using the methods "GET", "HEAD", "POST", "PUT", "DELETE"
// We insist, don't do this without consideration in production systems.
func preflightHandler(w http.ResponseWriter, r *http.Request) {
headers := []string{"Content-Type", "Accept"}
headers := []string{"Content-Type", "Accept", "Authorization"}
w.Header().Set("Access-Control-Allow-Headers", strings.Join(headers, ","))
methods := []string{"GET", "HEAD", "POST", "PUT", "DELETE"}
w.Header().Set("Access-Control-Allow-Methods", strings.Join(methods, ","))
Expand Down

0 comments on commit c234fc3

Please sign in to comment.