Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Attempt to prevent responses with Transfer-Encoding: chunked
It's probably a bad idea to implement Transfer-Encoding chunked inside an application, since only HTTP/1.1 supports it. However, some applications and frameworks still do so. However, they should only do so if they receive an HTTP/1.1 request, it's certainly a bug in the application to use Transfer-Encoding: chunked for HTTP/1.0 requests. Set SERVER_PROTOCOL and HTTP_VERSION to HTTP/1.0 in requests to try to avoid responses with Transfer-Encoding: chunked. While here, avoid 4 unnecessary hash allocations by using either Hash#merge! instead of #merge, or using Hash#[]= instead of allocating a hash to pass to Hash#update.
- Loading branch information