From dd201744d228934affd464ad706b8300e8395a89 Mon Sep 17 00:00:00 2001 From: 180909 <734461790@qq.com> Date: Mon, 5 Jul 2021 00:37:04 +0800 Subject: [PATCH] Add OPTIONS Method To AllowMethods --- cors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cors.go b/cors.go index c872e3f..c152665 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,