我们正在将我们的联邦政府网站转移到https。我们已经收到来自我们链接的网站的投诉,当这些网站只使用http时,我们的推荐人已经消失了。这是因为https->http降级,默认情况下,隐藏了引用程序。
我们正在尝试使用header Referrer-Policy: origin-when-cross-origin,但它似乎不起作用。然而,对于大多数浏览器来说,使用<meta name='referrer' content='origin-when-cross-origin'>确实提供了正确的行为。
我们正在设置标题:
<pre>
$ curl -sI https://www.ncbi.nlm.nih.gov/corecgi/tests/testref.cgi
HTTP/1.1 200 OK
Date: Fri, 04 Nov 2016 20:53:38 GMT
Server: Apache
Strict-Transport-Security: max-age=31536000; includeSubDomains; preload
Content-Security-Policy: upgrade-insecure-requests
Referrer-Policy: origin-when-cross-origin
Content-Security-Policy-Report-Only: default-src https:; script-src https: 'unsafe-inline' 'unsafe-eval'; font-src https: data:; img-src https: data:; style-src https: 'unsafe-inline'; report-uri https://www.ncbi.nlm.nih.gov/corecgi/csp/csp.cgi
Referrer-Policy: origin-when-cross-origin
Access-Control-Allow-Methods: POST, GET, PUT, OPTIONS, PATCH, DELETE
Access-Control-Allow-Origin:
Access-Control-Allow-Credentials: true
Access-Control-Allow-Headers: X-Accept-Charset,X-Accept,Content-Type,X-Requested-With,NCBI-SID,NCBI-PHID
Content-Type: text/html
Vary: Accept-Encoding
X-UA-Compatible: IE=Edge
X-XSS-Protection: 1; mode=block
</pre>
但是这个标题不起作用:
尝试如下:https://www.ncbi.nlm.nih.gov/corecgi/tests/testref.cgi注意到https->http降级链接发送一个空标题
然而,<meta>元素给出了所需的行为:https://www.ncbi.nlm.nih.gov/corecgi/tests/testref.cgi?meta=true
还有人有这个问题吗?
发布于 2016-11-08 18:51:26
看来Chrome即将支持Referrer-Policy报头,但还不完全支持:
它将在Chrome 56稳定版上提供。从Chrome 53开始,它就一直在旗子后面,所以你可以用--enable-experimental-web-platform-features运行Chrome来试用它。
Referrer-策略头支持将在Firefox 50中发布:
https://stackoverflow.com/questions/40431621
复制相似问题