Created
July 4, 2015 08:53
-
-
Save ckeyer/79086baee7589a754545 to your computer and use it in GitHub Desktop.
跨域访问WebApi服务器是出现 No 'Access-Control-Allow-Origin' 的问题
This file contains 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
package controllers | |
import ( | |
"github.com/astaxie/beego" | |
) | |
type Controller struct { | |
beego.Controller | |
} | |
func (this *Controller) Prepare() { | |
this.Ctx.ResponseWriter.Header().Add("Access-Control-Allow-Origin", "*") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment