`

chrome cors 请求在localhost下失败

阅读更多

chrome在做cors请求时,如果server是localhost,会失败,参考:https://code.google.com/p/chromium/issues/detail?id=67743

 

有如下几种处理方式:

1.  增加header

http://williamjohnbert.com/2013/06/allow-cors-with-localhost-in-chrome/

2. 在hosts中做映射,把127.0.0.1映射成一个域名

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics