Skip to content

Commit

Permalink
Merge pull request #10 from gainings/allow_additonal_http_methods
Browse files Browse the repository at this point in the history
allow http methods other than  when simple request
  • Loading branch information
deadcheat committed Dec 7, 2018
2 parents 06bed66 + b943e46 commit a90fd58
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cors.go
Expand Up @@ -54,7 +54,7 @@ func WithConfig(service *goa.Service, conf *GoaCORSConfig) goa.Middleware {
allowedOrigin, _ := om.FindMatchedOrigin(conf.AllowOrigins, origin)

// Simple request
if req.Method == http.MethodGet || req.Method == http.MethodPost || req.Method == http.MethodHead {
if req.Method != http.MethodOptions {
rw.Header().Add(HeaderVary, HeaderOrigin)
rw.Header().Set(HeaderAccessControlAllowOrigin, allowedOrigin)
if conf.AllowCredentials && allowedOrigin != "*" && allowedOrigin != "" {
Expand Down

0 comments on commit a90fd58

Please sign in to comment.