From e018a347118118f267755b872d671f204ee7170a Mon Sep 17 00:00:00 2001 From: Brad Rydzewski Date: Fri, 5 Feb 2016 13:04:46 -0800 Subject: [PATCH] Added CORS to header to OPTIONS request --- router/middleware/header/header.go | 1 + 1 file changed, 1 insertion(+) diff --git a/router/middleware/header/header.go b/router/middleware/header/header.go index 0e0eaee7..dcd806cf 100644 --- a/router/middleware/header/header.go +++ b/router/middleware/header/header.go @@ -25,6 +25,7 @@ func Options(c *gin.Context) { if c.Request.Method != "OPTIONS" { c.Next() } else { + c.Header("Access-Control-Allow-Origin", "*") c.Header("Access-Control-Allow-Methods", "GET,POST,PUT,PATCH,DELETE,OPTIONS") c.Header("Access-Control-Allow-Headers", "Authorization") c.Header("Allow", "HEAD,GET,POST,PUT,PATCH,DELETE,OPTIONS")