Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upHandle multiple Content-Length headers with the same value #92
Comments
|
This is one of those places where we definitely should do that if it's necessary for real world interoperability, but I'm reluctant to jump through hoops for it unless it is necessary for real world interoperability. Do you know of cases where folks are relying on duplicate identical content-lengths being accepted? Are you filing this because you ran into a case where the current behaviour broke something...? |
|
User reported this issue on the HTTPX issue tracker: encode/httpx#740 |
|
Yep, I see it:
Also, some websearching suggests that Chrome actually shipped some versions that errored out on pages like that (see e.g. https://varnish-cache.org/lists/pipermail/varnish-bugs/2010-October/003222.html), but Chrome no longer errors out on that site, so they must have explicitly decided to revert that change for better interoperability. So, ugh, fine, I guess we should support it too. I guess supporting it for our own content-length tracking is straightforward enough. Some questions:
|
|
I'm thinking the following for those questions:
and
into and still error on |
From RFC 7230 Section 3.3.2:
Currently h11 will error out if multiple
Content-Lengthheaders are sent even when equal in value. Perhaps we should collapse the multiple headers into only one or allow the duplicate to pass through if the values are the same?