- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
确保查询字符串不会作为 HTTP Referrer 数据的一部分包含在内的最佳方法是什么?
我注意到一些潜在的敏感信息(例如 UTM 字段,实际上并不需要 SSL)否则可能会泄露。
目标是针对原始 URL,例如:
http://mywebsite.com/mypage/?myvar=xxx
仅作为引荐来源网址传递:
http://mywebsite.com/mypage/
我已经阅读了 referrer policy元指令( <meta name="referrer" content="origin">
), 但 it doesn't seem to be widely implemented .
最佳答案
我会说你应该使用 noreferrer
指令,可以在单独的链接( <a rel="noreferrer">
)中,也可以像您所说的那样设置引荐来源政策。
但还有其他解决方案,即 hack:像这样:
Another referrer hiding method is to convert the original link URL to a Data URI scheme-based URL containing small HTML page with a meta refresh to the original URL. When the user is redirected from the data: page, the original referrer is hidden. The first public implementation of this method is the Darefer app for ownCloud
引用自:https://en.wikipedia.org/wiki/HTTP_referer#Referer_hiding
附言。这完全是为了完全隐藏引荐来源 header ,而不仅仅是删除查询字符串。
关于http - 如何在 HTTP Referrer 中不包含 URL 查询字符串,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37344253/
我是一名优秀的程序员,十分优秀!