[英]Unable to access a custom header in HTTP response
I have a node js server in which i am setting a custom header. 我有一个节点js服务器,我在其中设置自定义标头。 To allow it to be accessed by browser i have set Access-control-expose-header.
为了允许浏览器访问它,我设置了Access-control-expose-header。 Using this i am able to get the header in Chrome Firefox but it is giving a error in Phantomjs "Refused to get unsafe header".
使用此工具,我可以在Chrome Firefox中获取标头,但Phantomjs中出现错误“拒绝获取不安全的标头”。 How can i get around this?
我该如何解决?
To get around this you need to set 'webSecurityEnabled' header as 'false' in options while opening a page using PhantomJs. 为了解决这个问题,您需要在使用PhantomJs打开页面时在选项中将'webSecurityEnabled'标头设置为'false'。
Checkout the options listed here https://github.com/nathanboktae/mocha-phantomjs#usage 检出此处列出的选项https://github.com/nathanboktae/mocha-phantomjs#usage
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.