From 0aa4a49147cbfe82014383b2b8f735146f37d29d Mon Sep 17 00:00:00 2001 From: siyahas Date: Tue, 9 Sep 2025 13:25:12 +0300 Subject: [PATCH] Extend CORS middleware to allow PATCH requests --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index eb522bf..45b72b9 100644 --- a/main.go +++ b/main.go @@ -22,7 +22,7 @@ func getEnv(k, def string) string { func CorsMiddleware() gin.HandlerFunc { return func(c *gin.Context) { c.Writer.Header().Set("Access-Control-Allow-Origin", "*") // Or specify specific origins - c.Writer.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, OPTIONS") + c.Writer.Header().Set("Access-Control-Allow-Methods", "GET, POST, PUT, DELETE, PATCH, OPTIONS") c.Writer.Header().Set("Access-Control-Allow-Headers", "Content-Type, Authorization") c.Writer.Header().Set("Access-Control-Expose-Headers", "Content-Length, Content-Type") c.Writer.Header().Set("Access-Control-Allow-Credentials", "true")