• Kenton Varda's avatar
    Allow app to send arbitrary Content-Length/Transfer-Encoding in HEAD responses. · be9b18c5
    Kenton Varda authored
    Previously, the app could control Content-Length by passing `expectedBodySize`. This is great for enabling code that "just works" by handling GET and HEAD requests identically.
    
    However, in somewhat more-complicated situations -- especilaly in proxies -- you end up having to write special-case hacks for HEAD requests to deal with the fact that the body is actually empty, but has a non-zero "expected" size.
    
    We can make life easier for proxies by allowing the application to directly set the Content-Length and Transfer-Encoding headers in the case of HEAD responses, much like we allow applications to set WebSocket-related headers on non-WebSocket requests/responses.
    
    This change actually fixes a bug in Cloudflare Workers where Content-Length is not passed through correctly for HEAD responses. No changes are needed on the Workers side (except adding a test).
    be9b18c5
Name
Last commit
Last update
c++ Loading commit data...
doc Loading commit data...
highlighting Loading commit data...
security-advisories Loading commit data...
.gitignore Loading commit data...
.travis.yml Loading commit data...
CMakeLists.txt Loading commit data...
CONTRIBUTORS Loading commit data...
LICENSE Loading commit data...
README.md Loading commit data...
RELEASE-PROCESS.md Loading commit data...
appveyor.yml Loading commit data...
mega-test-kenton-home.cfg Loading commit data...
mega-test-kenton-work.cfg Loading commit data...
mega-test-quick.cfg Loading commit data...
mega-test.py Loading commit data...
release.sh Loading commit data...
style-guide.md Loading commit data...
super-test.sh Loading commit data...