HTTP 1.x chunked transfer encoding + content length header conflict
- Dominant language
- Python
- Stars
- 2.7k
- Forks
- 292
- Avg merge
- 2d 15h
- Merged PRs (30d)
- 3
Description
My application serves (large) binary files. It serves those files with the following headers:
```
Content-Length: 163840
Content-Type: application/octet-stream
Transfer-Encoding: chunked
```
When the request is handled over HTTP 2.x, this does not result in any issues. However, upon fallback to HTTP 1.x, this results in an error. The issue can be replicated by executing `curl -X GET http://host/file.db`, forcing the fallback by using HTTP 1.x.
The following error is returned:
```
curl: (56) Illegal or missing hexadecimal sequence in chunked-encoding
```
Some web servers, like [Uvicorn](https://www.uvicorn.org/server-behavior/#:~:text=If%20a%20Transfer-Encoding%20header%20is%20included%20then%20any%20Content-Length%20header%20will%20be%20ignored.) for example, solve this by ignoring the content-length header when any transfer-encoding is set. Would it be desirable to replicate this behavior in Daphne?
---
Daphne version: 3.0.2
Python 3.9.5
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.