Renann Prado 9 years ago
parent
commit
455c49c79c
1 changed files with 1 additions and 1 deletions
  1. 1 1
      config.go

+ 1 - 1
config.go

@@ -41,6 +41,7 @@ func (cors *cors) applyCors(c *gin.Context) {
 
 
 	if c.Request.Method == "OPTIONS" {
 	if c.Request.Method == "OPTIONS" {
 		cors.handlePreflight(c)
 		cors.handlePreflight(c)
+		defer c.AbortWithStatus(200)
 	} else {
 	} else {
 		cors.handleNormal(c)
 		cors.handleNormal(c)
 	}
 	}
@@ -66,7 +67,6 @@ func (cors *cors) validateOrigin(origin string) bool {
 }
 }
 
 
 func (cors *cors) handlePreflight(c *gin.Context) {
 func (cors *cors) handlePreflight(c *gin.Context) {
-	c.AbortWithStatus(200)
 	header := c.Writer.Header()
 	header := c.Writer.Header()
 	for key, value := range cors.preflightHeaders {
 	for key, value := range cors.preflightHeaders {
 		header[key] = value
 		header[key] = value