add origin, content-type, accept to CORS conf

This commit is contained in:
Brad Rydzewski 2016-02-05 13:39:11 -08:00
parent e018a34711
commit 398db0bda2

View file

@ -27,7 +27,7 @@ func Options(c *gin.Context) {
} else { } else {
c.Header("Access-Control-Allow-Origin", "*") c.Header("Access-Control-Allow-Origin", "*")
c.Header("Access-Control-Allow-Methods", "GET,POST,PUT,PATCH,DELETE,OPTIONS") c.Header("Access-Control-Allow-Methods", "GET,POST,PUT,PATCH,DELETE,OPTIONS")
c.Header("Access-Control-Allow-Headers", "Authorization") c.Header("Access-Control-Allow-Headers", "authorization, origin, content-type, accept")
c.Header("Allow", "HEAD,GET,POST,PUT,PATCH,DELETE,OPTIONS") c.Header("Allow", "HEAD,GET,POST,PUT,PATCH,DELETE,OPTIONS")
c.Header("Content-Type", "application/json") c.Header("Content-Type", "application/json")
c.AbortWithStatus(200) c.AbortWithStatus(200)