使用 Transfer-Encoding 分块的 HTTP GET
HTTP GET with Transfer-Encoding Chunked
我最近看到一个 GET 调用,其中 Transfer-Encoding header 设置为 Chunked。我们从这个调用中注意到的是延迟,然后是 500 套接字超时。
深入挖掘,我们展示了来自 ELB 和 Apache Web 服务器的 500 个行为。
值得注意的是,如果我们使用 Transfer-Encoding 作为 Chunked 进行 GET 调用并包含一个空负载,在我们的例子中,ELB 允许请求正常通过。
鉴于此 ELB 和 Apache 网络服务器表现出这种行为,我的问题是发送 Transfer-Encoding 作为 HTTP GET 调用上的分块是否有效?
Transfer-Encoding
header 现在由 RFC 7230, section 3.3.1 (see also the IANA Message Header Registry 授权。你会发现这个 header 是 HTTP 消息框架的一部分,所以它对请求和响应都有效。
牢记 GET
requests may carry bodies, the reaction of the server(s) is absolutely correct. What is causing the delay followed by the 500 is probably the following: The server would expect a body but fails to find one, since the chunk-encoded representation of an empty string is not an empty string but a zero-sized chunk。结果,服务器 运行 超时。
我最近看到一个 GET 调用,其中 Transfer-Encoding header 设置为 Chunked。我们从这个调用中注意到的是延迟,然后是 500 套接字超时。
深入挖掘,我们展示了来自 ELB 和 Apache Web 服务器的 500 个行为。
值得注意的是,如果我们使用 Transfer-Encoding 作为 Chunked 进行 GET 调用并包含一个空负载,在我们的例子中,ELB 允许请求正常通过。
鉴于此 ELB 和 Apache 网络服务器表现出这种行为,我的问题是发送 Transfer-Encoding 作为 HTTP GET 调用上的分块是否有效?
Transfer-Encoding
header 现在由 RFC 7230, section 3.3.1 (see also the IANA Message Header Registry 授权。你会发现这个 header 是 HTTP 消息框架的一部分,所以它对请求和响应都有效。
牢记 GET
requests may carry bodies, the reaction of the server(s) is absolutely correct. What is causing the delay followed by the 500 is probably the following: The server would expect a body but fails to find one, since the chunk-encoded representation of an empty string is not an empty string but a zero-sized chunk。结果,服务器 运行 超时。