From e84fc909abfd958ded115b752bbc7bf8776ea332 Mon Sep 17 00:00:00 2001 From: Zed Date: Thu, 16 Apr 2020 01:24:43 +0800 Subject: [PATCH] fix: add `DELETE` to cors --- backend/middlewares/cors.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/backend/middlewares/cors.go b/backend/middlewares/cors.go index 01ae1c0..58d8a67 100644 --- a/backend/middlewares/cors.go +++ b/backend/middlewares/cors.go @@ -9,7 +9,7 @@ import ( func CorsMiddleware() gin.HandlerFunc { return cors.New(cors.Config{ //AllowOrigins: []string{"http://localhost:3000", "http://192.168.50.196:3000"}, - AllowMethods: []string{"PUT", "PATCH", "POST", "GET", "OPTIONS"}, + AllowMethods: []string{"PUT", "PATCH", "POST", "GET", "OPTIONS", "DELETE"}, AllowHeaders: []string{"Origin", "Content-Type", "Authorization"}, ExposeHeaders: []string{"Content-Length"}, AllowCredentials: true,