代码之家  ›  专栏  ›  技术社区  ›  tinkerr

如何跨子域保留Referer(Referer HTTP头)?

  •  0
  • tinkerr  · 技术社区  · 5 年前

    我有一个网站正在运行 www.example.com 这使得GET请求 api.example.com 处理表格。当我检查web服务器日志时 应用程序编程接口。实例通用域名格式 我看到Safari的请求得到了完整的推荐(例如。, www.example.com/page-where-request-originated ).但Chrome的请求只能得到部分推荐( www.example.com ).

    我需要的能力,跟踪完整的参考页时,请求点击 应用程序编程接口。实例通用域名格式 .回顾 documentation for Referrer-Policy 看来我唯一的选择就是把它设为 unsafe-url .但这似乎太过分了,因为我只想把推荐人发送到 example.com .可能吗?

    0 回复  |  直到 5 年前
        1
  •  0
  •   jahller    4 年前

    我能找到的唯一选择是 strict-origin : Send the origin as referrer, but only when the request is no downgrade from https to http .

    见: https://wiki.crashtest-security.com/enable-security-headers

    其他所有内容要么完全忽略引用者,要么发送不带任何URL参数的源URL。

    推荐文章