Skip to content

Instantly share code, notes, and snippets.

@inferno
Created September 25, 2014 08:28
Show Gist options
  • Select an option

  • Save inferno/0f68f7ab5c8f675526fb to your computer and use it in GitHub Desktop.

Select an option

Save inferno/0f68f7ab5c8f675526fb to your computer and use it in GitHub Desktop.
c.Writer.Header().Set("Access-Control-Allow-Origin", "*")
c.Writer.Header().Set(
"Access-Control-Allow-Methods",
"POST, GET, OPTIONS, PUT, PATCH, DELETE")
c.Writer.Header().Set(
"Access-Control-Allow-Headers",
"Content-Type, Content-Length, Accept-Encoding, X-Original-Filename, X-Access-Token, Authorization")
if c.Request.Method == "OPTIONS" {
c.Abort(200)
return
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment