【问题标题】:Set HTTP REFERRER on HTTPS to HTTPS site将 HTTPS 上的 HTTP REFERRER 设置为 HTTPS 站点
【发布时间】:2013-01-31 01:11:14
【问题描述】:

谁能告诉我如何避免 http REFERRER url。我有一个 html 表单,我想使用 Javascript 发布表单。是否可以将 REFERRER url 设置为 NULL。 这是代码,请让我知道这是否可能,或者您有其他选择 感谢您的帮助

<!DOCTYPE html>
<html>
<body>

<script type="text/javascript">
document.write('<form id="l" method="post" action="https://www.test.com">');
document.write('<input type="hidden" id="e" name="email">');
document.write('<input type="hidden" name="pass" id="p"></form>');

function g(x){

  return document.getElementById(x);
}

g('e').value='username';
g('p').value="password";
g('l').submit();
</script>

</body>
</html>

【问题讨论】:

  • 拥有引荐网址有什么不好?
  • 我明白它的有用和重要,但我需要意识到这一点,所以想知道我是否能做到
  • 搞乱浏览器集标题,这听起来确实合法;)
  • 标记为答案是不可能的,我将其标记为答案

标签: php javascript html .net


【解决方案1】:

Referer 标头是浏览器发送到服务器的内容。您无法更改它,因为浏览器不提供 javascript api 来更改它。

浏览器发送窗口对象的location.href。如果您将其更改为 location.href = "http://www.google.com" 之类的其他内容,浏览器将从您的页面导航到 http://www.google.com

【讨论】:

  • 你能告诉我它发送引荐来源网址的依据是什么。如果它的 https 到 https 重定向它不会设置它吗?
猜你喜欢
  • 1970-01-01
  • 2010-10-20
  • 2019-10-18
  • 1970-01-01
  • 2014-04-23
  • 2013-10-26
  • 1970-01-01
  • 2017-01-22
  • 2017-09-06
相关资源
最近更新 更多