单击搜索结果后,Google如何设置HTTP Referrer [英] How does Google sets HTTP Referrer after a search result click

查看:157
本文介绍了单击搜索结果后,Google如何设置HTTP Referrer的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

例如,在

For example, the first search result on this page leads to the older SO question, with the following HTTP request:

GET /questions/4402502/how-does-google-set-the-http-referrer-when-someone-clicks-on-a-search-result-lin HTTP/1.1
Host    stackoverflow.com
Referer https://www.google.ru

请注意:

  1. Referer标头中仅包含域,没有查询字符串.
  2. Google通过HTTPS打开,而SO通过普通HTTP打开-尽管如此,Referer标头是由浏览器发送的.
  3. 不涉及服务器端重定向,单击后打开的第一个HTTP查询是目标站点.

问题是,他们如何实现这一目标?

The question is, how do they achieve this?

推荐答案

Google使用推荐人政策. 它们在页面中包含meta标记:

Google makes use of Referrer Policy. They include the meta tag in the page:

<meta name="referrer" content="origin">

这告诉浏览器使用仅起源"策略,即在任何后续请求中在引荐来源"标头中发送仅域信息.

This tells browsers to use "Origin Only" policy, that is, to send domain only information in the Referrer header in any subsequent request.

这篇关于单击搜索结果后,Google如何设置HTTP Referrer的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆