Skip to content

Commit

Permalink
Add HEAD to simple (default) methods
Browse files Browse the repository at this point in the history
Fix #40
  • Loading branch information
rs committed Aug 1, 2017
1 parent 7af7a1e commit eabcc6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions cors.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ type Options struct {
// set, the content of AllowedOrigins is ignored.
AllowOriginFunc func(origin string) bool
// AllowedMethods is a list of methods the client is allowed to use with
// cross-domain requests. Default value is simple methods (GET and POST)
// cross-domain requests. Default value is simple methods (HEAD, GET and POST).
AllowedMethods []string
// AllowedHeaders is list of non simple headers the client is allowed to use with
// cross-domain requests.
Expand Down Expand Up @@ -154,7 +154,7 @@ func New(options Options) *Cors {
// Allowed Methods
if len(options.AllowedMethods) == 0 {
// Default is spec's "simple" methods
c.allowedMethods = []string{"GET", "POST"}
c.allowedMethods = []string{"GET", "POST", "HEAD"}
} else {
c.allowedMethods = convert(options.AllowedMethods, strings.ToUpper)
}
Expand Down

0 comments on commit eabcc6a

Please sign in to comment.