码迷,mamicode.com
首页 > 系统相关 > 详细

golang macaron解决跨域

时间:2020-06-05 13:11:18      阅读:75      评论:0      收藏:0      [点我收藏+]

标签:put   header   div   head   eth   ola   res   ext   origin   

m.Handlers(func(ctx *macaron.Context) {
   ctx.Resp.Header().Set("Access-Control-Allow-Origin","*")
   ctx.Resp.Header().Set("Access-Control-Allow-Headers", "content-type,token")
   ctx.Resp.Header().Set("Access-Control-Allow-Methods", "POST, OPTIONS, GET, PUT")
})

  

golang macaron解决跨域

标签:put   header   div   head   eth   ola   res   ext   origin   

原文地址:https://www.cnblogs.com/zipon/p/13048946.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!