google-chrome - Dnsmasq 无法捕获 https 的 307 重定向?

标签 google-chrome redirect ssl dnsmasq hsts

我目前正在我的网站上进行一些调试,其中涉及调用 facebook API。我已经安装了 dnsmasq 来与我的 mac os X 配合使用,将所有对 facebook.com 的请求重定向到 127.0.0.1

这是我在 dnsmasq.conf 中的条目:

address=/facebook.com/127.0.0.1

我还有 /etc/resolver/comnameserver 127.0.0.1

当我打开 dnsmasq 时,访问 facebook.com 将导致 Chrome 中出现 PAGE NOT FOUND 错误。这表明我的 dnsmasq 正在工作。

但是,我注意到chrome会重定向http://www.facebook.comhttps://www.facebook.com由于 HSTS。我继续访问 chrome://net-internals#hsts 删除 facebook.com 的条目。

奇怪的是,当我调试时,我看到 facebook.com 确实返回了 http://www.facebook.com 的 307 重定向。 (见图)

enter image description here

这很奇怪,因为域名 facebook.com 目前在我的计算机上解析为 127.0.0.1!此外,当我深入研究该请求时,我确实发现该请求是有效的:

enter image description here

如果 facebook.com 无法解析,这个 307 重定向来自哪里?

最佳答案

307 是基于内部浏览器的重定向,用于 HTTP 严格传输安全 (HSTS)。它不是来自服务器 - 它是浏览器创建的虚假响应。

关于google-chrome - Dnsmasq 无法捕获 https 的 307 重定向?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/41239585/

相关文章:

c++ - 使用 ssl 的 boost asio 中的详细信息

javascript - 在 Chrome 中加载页面时,如何捕获所有网络请求和完整响应数据?

google-chrome - Chrome 扩展已下架。你是如何进行的?

javascript - iframe 的内容无法仅在 iframe 中打开

tomcat - 独立 Tomcat 保护免受指向其 IP 的流氓域

node.js - Node JS 与 SSL pfx 文件的问题

javascript - 谷歌浏览器 : how to find original line from minified line using a source map?

c# - 在 Chrome 浏览器中运行测试时,编码的 Ui 播放无法找到给定的搜索控件

php - .htaccess 重定向文件类型

ssl - RSA 服务器证书 apache2