Created
September 25, 2014 08:28
-
-
Save inferno/0f68f7ab5c8f675526fb to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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