From 73a1e3b8eb29426ddd7c5348b0a2d8fbebc825ca Mon Sep 17 00:00:00 2001 From: 180909 Date: Wed, 11 Aug 2021 08:16:19 +0800 Subject: [PATCH] Add OPTIONS Method To AllowMethods (#76) --- cors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cors.go b/cors.go index a58154a..6827535 100644 --- a/cors.go +++ b/cors.go @@ -145,7 +145,7 @@ func (c Config) parseWildcardRules() [][]string { // DefaultConfig returns a generic default configuration mapped to localhost. func DefaultConfig() Config { return Config{ - AllowMethods: []string{"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD"}, + AllowMethods: []string{"GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"}, AllowHeaders: []string{"Origin", "Content-Length", "Content-Type"}, AllowCredentials: false, MaxAge: 12 * time.Hour,