notes icon indicating copy to clipboard operation
notes copied to clipboard

header status text missing or 头信息状态码后面的提示信息丢失

Open lanlin opened this issue 7 years ago • 0 comments

情景

当在 Nginx 中启用了 http2 协议后,会发现请求返回的头信息中已经不包含状态信息了。 也就是除了 statusCode 以外,http 1.1 中的 statusText 或者 statusMessage 不见了。

原因

http2 中已经移除了对于 statusText 的支持,原因就是这群大佬认为那玩意没什么卵用。。。

解决办法

没有解决办法!也就是说你不能用 http2 的同时,又要求它能够支持 statusText。 那么只有自己在 response 的头信息中添加一个自定义的 header 项来返回所需要的状态信息了。

吐槽

有的时候,也有蛋痛的感觉。。。

lanlin avatar May 31 '18 03:05 lanlin