HTTP2 时连接 header 消失
Connection header disapper when HTTP2
在使用 curl 和 HTTP 1.1 向我的网站发出请求时,我明确地看到了我的 keep-alive
连接 header:
$ curl https://website.com/ -i
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 2
Connection: keep-alive
但是使用 Chrome 的开发者工具和 HTTP 2 header 是缺失的:
Content-Type: text/html; charset=utf-8
Content-Length: 2
在 HTTP 2 中不发送连接 header 是否正常(为什么)?
是的,这是正常的,由HTTP/2 RFC指定。
在使用 curl 和 HTTP 1.1 向我的网站发出请求时,我明确地看到了我的 keep-alive
连接 header:
$ curl https://website.com/ -i
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
Content-Length: 2
Connection: keep-alive
但是使用 Chrome 的开发者工具和 HTTP 2 header 是缺失的:
Content-Type: text/html; charset=utf-8
Content-Length: 2
在 HTTP 2 中不发送连接 header 是否正常(为什么)?
是的,这是正常的,由HTTP/2 RFC指定。