免费工具 HTTP 响应头检查:看服务器到底返回了什么
输入一个网址,按浏览器或爬虫的身份访问一次,列出状态码和服务器返回的每一个响应头,逐条用中文说明是干什么的。下面的检查清单会指出缺了什么:HSTS、内容安全策略(CSP)、防点击劫持、X-Robots-Tag 里误留的 noindex、不安全的 Cookie。
- 状态码 + 全部响应头
- 安全与 SEO 检查
- 点了才发请求
查看一个网址的响应头
填页面地址。有跳转会自动跟随,显示的是最终页面的响应头;勾选下面的选项可以看每一跳。点「检查」之前,下面是 github.com 的示例结果。
check.tapcub.com,由它从 Cloudflare 的网络用页面上显示的 User-Agent 去访问,请求里带 From: tools@tapcub.com,再把状态码、响应头和页面前 512 KB 返回给你的浏览器。点一次用 1 个请求。服务端只为限流记录域名、状态码和耗时,不记路径、参数和页面内容,也不保存检查结果。额度:每个 IP 每分钟 10 次、每天 200 次请求。完整地址或只写域名都行,不写 https:// 会自动补上。
请求里带的 User-Agent。有的服务器对爬虫和普通访客返回的不一样。
最终响应
200 OK · 1,366 ms · https://github.com/
状态码、服务器响应用时、最终地址。
检查结果
缺失或有风险的响应头排在前面;「提示」值得了解,一般不急。
- 通过没有发现缺失的安全头或索引相关问题。
- 通过HSTS 设了一年以上,带 includeSubDomains 和 preload,满足浏览器预加载列表的要求。
响应头
按用途分组。值太长被截断的,鼠标悬停可以看全文。
| 响应头 | 值 | 类别 | 作用 |
|---|---|---|---|
| content-security-policy | default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; conn… | 安全 | 内容安全策略:脚本、样式、框架、请求分别允许从哪些来源加载。 |
| referrer-policy | origin-when-cross-origin, strict-origin-when-cross-origin | 安全 | 跳到下一个网站时,Referer 里带上本页地址的多少部分。 |
| strict-transport-security | max-age=31536000; includeSubdomains; preload | 安全 | 要求浏览器在 max-age 秒内只用 https 访问这个域名。 |
| x-content-type-options | nosniff | 安全 | nosniff:浏览器不得猜测成别的文件类型。 |
| x-frame-options | deny | 安全 | 别的网站能不能把本页嵌进框架(DENY 或 SAMEORIGIN)。 |
| x-xss-protection | 0 | 安全 | 旧的 XSS 过滤开关,现在的浏览器不理会。 |
| content-language | en-US | SEO | 内容语言;搜索引擎主要还是看页面本身。 |
| cache-control | max-age=0, private, must-revalidate | 缓存 | 浏览器和 CDN 的缓存规则:max-age、no-cache、private、s-maxage…… |
| etag | W/"1ae45a932e4a2d23044a8015afb6c4a3" | 缓存 | 版本标识;浏览器用 If-None-Match 再验证,可能拿到 304。 |
| vary | X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With, X-GitHub-Client-Version, Accept-Language, Sec-Fetch-Site,Accept-Encoding, Accept, X-Reques… | 缓存 | 哪些请求头会改变响应;缓存按这些值分别存一份。 |
| content-type | text/html; charset=utf-8 | 内容 | 文件类型和字符集。 |
| transfer-encoding | chunked | 内容 | chunked:事先不知道长度,分块传输。 |
| set-cookie | _gh_sess=… | Cookie | Cookie _gh_sess;值太长,这里看不到它的属性。 |
| set-cookie | _octo=…; expires=Wed, 17 Nov 2027 12:57:22 GMT; domain=.github.com; path=/; secure; SameSite=Lax | Cookie | Cookie _octo,到期前一直保留。属性:Secure · SameSite=Lax。 |
| set-cookie | logged_in=…; expires=Wed, 17 Nov 2027 12:57:22 GMT; domain=.github.com; path=/; HttpOnly; secure; SameSite=Lax | Cookie | Cookie logged_in,到期前一直保留。属性:Secure · HttpOnly · SameSite=Lax。 |
| server | github.com | 服务器 / CDN | 服务器或 CDN 自报的软件名称。 |
| accept-ranges | bytes | 其他 | — |
| date | Tue, 17 Nov 2026 12:57:15 GMT | 其他 | — |
| x-github-edge-region | westus3 | 其他 | — |
| x-github-request-id | D294:38A454:69683:D932A:6AFC4F32 | 其他 | — |
跳转经过
HTTP 200 OK
accept-ranges: bytes
cache-control: max-age=0, private, must-revalidate
content-language: en-US
content-security-policy: default-src 'none'; base-uri 'self'; child-src github.githubassets.com github.com/assets-cdn/worker/ github.com/assets/ gist.github.com/assets-cdn/worker/; connect-src 'self' uploads.github.com www.githubstatus.com collector.github.com raw.githubusercontent.com api.github.com github-cloud.s3.amazonaws.com github-production-repository-file-5c1aeb.s3.amazonaws.com github-production-upload-manifest-file-7fdce7.s3.amazonaws.com github-production-user-asset-6210df.s3.amazonaws.com *.rel.tunnels.api.visualstudio.com wss://*.rel.tunnels.api.visualstudio.com github.githubassets.com objects-origin.githubusercontent.com copilot-proxy.githubusercontent.com proxy.individual.githubcopilot.com proxy.business.githubcopilot.com proxy.enterprise.githubcopilot.com *.actions.githubusercontent.com wss://*.actions.githubusercontent.com productionresultssa0.blob.core.windows.net productionresultssa1.blob.core.windows.net productionresultssa2.blob.core.windows.net productionresultssa3.blob.core.windows.net productionresultssa4.blob.core.windows.net productionresultssa5.blob.core.windows.net productionresultssa6.blob.core.windows.net productionresultssa7.blob.core.windows.net productionresultssa8.blob.core.windows.net productionresultssa9.blob.core.windows.net productionresultssa10.blob.core.windows.net productionresultssa11.blob.core.windows.net productionresultssa12.blob.core.windows.net productionresultssa13.blob.core.windows.net productionresultssa14.blob.core.windows.net productionresultssa15.blob.core.windows.net productionresultssa16.blob.core.windows.net productionresultssa17.blob.core.windows.net productionresultssa18.blob.core.windows.net productionresultssa19.blob.core.windows.net productionresultssa30.blob.core.windows.net productionresultssa31.blob.core.windows.net productionresultssa32.blob.core.windows.net github-production-repository-image-32fea6.s3.amazonaws.com github-production-release-asset-2e65be.s3.amazonaws.com insights.github.com wss://alive.github.com wss://alive-s…
content-type: text/html; charset=utf-8
date: Tue, 17 Nov 2026 12:57:15 GMT
etag: W/"1ae45a932e4a2d23044a8015afb6c4a3"
referrer-policy: origin-when-cross-origin, strict-origin-when-cross-origin
server: github.com
strict-transport-security: max-age=31536000; includeSubdomains; preload
transfer-encoding: chunked
vary: X-PJAX, X-PJAX-Container, Turbo-Visit, Turbo-Frame, X-Requested-With, X-GitHub-Client-Version, Accept-Language, Sec-Fetch-Site,Accept-Encoding, Accept, X-Requested-With
x-content-type-options: nosniff
x-frame-options: deny
x-github-edge-region: westus3
x-github-request-id: D294:38A454:69683:D932A:6AFC4F32
x-xss-protection: 0
set-cookie: _gh_sess=…
set-cookie: _octo=…; expires=Wed, 17 Nov 2027 12:57:22 GMT; domain=.github.com; path=/; secure; SameSite=Lax
set-cookie: logged_in=…; expires=Wed, 17 Nov 2027 12:57:22 GMT; domain=.github.com; path=/; HttpOnly; secure; SameSite=Lax分享这组输入:数值写在链接的 # 后面,不会发到服务器。
https://tapcub.com/zh/tools/http-header-checker
版本 v1.0更新于 更新记录
先看这四类
响应头的问题大多落在下面四类里,检查清单也是按这个顺序排的。
状态码
第一行决定一切:200 是正常页面,301 / 308 是永久跳转,302 / 307 是临时跳转,404 / 410 是不存在,5xx 是服务器出错。想被搜索引擎收录的页面,最终必须是 200。
安全头
HSTS 强制 https,CSP 限制脚本来源,X-Frame-Options 或 frame-ancestors 防点击劫持,nosniff 防类型猜测。缺了算警告,不算故障:网站照样能用,只是更容易被攻击。
索引相关
X-Robots-Tag 可以在 HTML 里看不出任何痕迹的情况下让页面 noindex,测试环境的配置被带到线上时很容易漏看。Link 头还可以带 canonical 和 hreflang。
缓存和 Cookie
Cache-Control 和 ETag 决定回访时要不要重新下载。Set-Cookie 的属性决定 Cookie 会不会走明文(缺 Secure)、能不能被脚本读到(缺 HttpOnly)、会不会跨站发送(SameSite)。
不同页面、http 和 https、不同 User-Agent,返回的响应头都可能不一样。重要的页面(首页、商品或文章页、跳转目标)各查一遍;怀疑搜索引擎看到的不一样时,换成百度蜘蛛或 Googlebot 再查。
三步
不用注册,不点按钮就不发请求。
-
1
填网址
页面地址、文件地址(CSS、图片、PDF)或者只写域名都可以。
-
2
选抓取身份
「电脑版 Chrome」看的是普通访客拿到的结果;换成百度蜘蛛、Googlebot、GPTBot,看服务器是否对爬虫区别对待。
-
3
看结果、改配置
按检查清单逐条处理,把原始响应头复制给负责服务器(nginx、宝塔、CDN 控制台)的同事。
怎么抓、怎么判断
经 check.tapcub.com 从 Cloudflare 的网络发一次 GET 请求,不管选哪个身份都一样:
- 跳转逐跳跟随(每一跳都重新校验地址),最多 5 跳;显示的是最终响应的响应头
- 正文不传回页面,只分析状态行和响应头;用时是各跳服务器响应时间之和,不含我们自己的 DNS 校验
- 服务端会把超过 2,000 字符的响应头值、超过 300 字符的单条 Set-Cookie 截断
- 判断依据:HTTP 和缓存按 RFC 9110 / 9111,HSTS 按 RFC 6797,CSP Level 3,Google 的 X-Robots-Tag 规范,旧响应头按 MDN 的建议
| 响应头 | 推荐值 | 缺失时 |
|---|---|---|
Strict-Transport-Security | max-age=31536000; includeSubDomains | https 页面报警告 |
Content-Security-Policy | 不含裸 'unsafe-inline' 的策略 | 警告 |
X-Frame-Options 或 frame-ancestors | DENY / SAMEORIGIN / 'self' | 警告 |
X-Content-Type-Options | nosniff | 提示 |
Referrer-Policy | strict-origin-when-cross-origin 或更严 | 提示(按浏览器默认) |
X-Robots-Tag | 想被收录的页面不要有 | noindex 报错误 |
Set-Cookie | Secure; HttpOnly; SameSite=Lax | 每个 Cookie 单独警告 |
读一读 github.com 的示例
页面上的示例是 2026-11-17 用电脑版 Chrome 身份抓的。几个关键响应头的意思如下。
| 响应头 | 值(节选) | 解读 |
|---|---|---|
| 状态码 | 200 OK | 正常页面,没有跳转 |
strict-transport-security | max-age=31536000; includeSubdomains; preload | 一年、包含子域名,符合浏览器预加载列表的条件 |
content-security-policy | default-src 'none'; … | 从「全部禁止」开始逐个放行来源,是最严格的写法 |
x-frame-options | deny | 任何网站(包括 GitHub 自己)都不能用框架嵌入 |
cache-control | max-age=0, private, must-revalidate | 个性化页面:不进共享缓存,每次都要重新验证 |
set-cookie | logged_in=…; HttpOnly; secure; SameSite=Lax | 脚本读不到、只走 https、跨站请求不带 |
这个页面的检查清单全是通过项。换成你自己的网站试试:常见的中小网站一般缺 CSP 和防框架嵌入,Server 或 X-Powered-By 里还常带着 nginx、PHP 的版本号。
容易漏掉的响应头问题
这些问题不影响页面打开,所以出事之前一般没人发现。
X-Robots-Tag 里留着 noindex
测试环境的规则跟着上线,页面从搜索结果里消失,HTML 里却看不出来。每次发布后查一下响应头。
源站和 CDN 不一致
源站加的响应头可能被 CDN 去掉或覆盖,反过来也一样。要测公开访问的网址,而不是直接测源站 IP。
只有 www 发了 HSTS
如果不带 www 的主域名不发 HSTS(或不先跳到 https),第一次访问仍然没有保护。
Cookie 不带属性
登录 Cookie 要有 Secure 和 HttpOnly;SameSite=None 不带 Secure 会被现在的浏览器直接拒收。
持续看爬虫和访客实际拿到了什么
响应头检查只是某一刻的快照。TapCub 持续记录:哪些爬虫来抓了你的页面、哪些页面出错、真实访客打开有多快。
怎么查看一个网站的响应头?
在上面填网址点「检查」。自己的浏览器里也能看:按 F12 打开开发者工具,切到「网络」,刷新后点第一个请求;命令行用 curl -I https://example.com/ 可以看 HEAD 请求的响应头。这个工具多了中文解释、自动跟随跳转,还能换成爬虫身份。
最重要的安全响应头有哪些?
Strict-Transport-Security、Content-Security-Policy、X-Frame-Options(或 CSP 的 frame-ancestors)、X-Content-Type-Options、Referrer-Policy。有敏感功能的网站还要看 Permissions-Policy 和跨域隔离相关的 COOP、COEP、CORP。X-XSS-Protection 已经过时。
为什么和我在浏览器里看到的不一样?
请求是从 Cloudflare 的网络发出的,不是你的电脑,也不带 Cookie。服务器可能按地区、User-Agent、Cookie、A/B 实验返回不同的响应头,CDN 缓存也可能替源站作答。国内网站如果对海外访问做了限制,结果也会不同。
怎么确认 X-Robots-Tag 有没有屏蔽页面?
用这个工具查一下,noindex 或 none 会标成错误。再换成 Googlebot 或百度蜘蛛身份查一次,因为响应头可以只针对某个爬虫(比如 googlebot: noindex)。
图片、PDF、JS 文件的响应头能查吗?
能,填文件地址就行。想让 PDF 或图片不被收录,X-Robots-Tag 是唯一的办法;静态文件的 Cache-Control 决定浏览器能缓存多久。
会跟随跳转吗?
会,最多 5 跳,显示最终响应的响应头。勾选「显示每一跳跳转」可以看每一步;要分析 301 和 302 的区别,用重定向检查工具。
我查的网址会被保存吗?
不会。检查服务只为限流记录域名、状态码和耗时,结果只留在这个浏览器标签页里,离开页面就没了。