From 455c49c79c25a3e69780cee2443bff9d39d5a976 Mon Sep 17 00:00:00 2001 From: Renann Prado Date: Sun, 26 Jun 2016 14:04:15 -0300 Subject: [PATCH] Fixes #2 --- config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config.go b/config.go index 264bfae..64319fd 100644 --- a/config.go +++ b/config.go @@ -41,6 +41,7 @@ func (cors *cors) applyCors(c *gin.Context) { if c.Request.Method == "OPTIONS" { cors.handlePreflight(c) + defer c.AbortWithStatus(200) } else { cors.handleNormal(c) } @@ -66,7 +67,6 @@ func (cors *cors) validateOrigin(origin string) bool { } func (cors *cors) handlePreflight(c *gin.Context) { - c.AbortWithStatus(200) header := c.Writer.Header() for key, value := range cors.preflightHeaders { header[key] = value