Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test mistake? #238

Closed
torsten-schenk opened this issue Aug 6, 2023 · 1 comment · Fixed by #239
Closed

Test mistake? #238

torsten-schenk opened this issue Aug 6, 2023 · 1 comment · Fixed by #239

Comments

@torsten-schenk
Copy link

torsten-schenk commented Aug 6, 2023

The test https://github.com/nodejs/llhttp/blob/main/test/request/content-length.md#no-error-on-simultaneous-content-length-and-transfer-encoding-identity-lenient specifies "Transfer-Encoding: identity" in the title but actually uses "Transfer-Encoding: chunked" in the test itself.

Expected: lenient parsing seems to accept Transfer-Encoding: chunked and Content-Length set at the same time. Is that the expected behaviour? Does it accept Transfer-Encoding: identity in lenient mode?

@ShogunPanda
Copy link
Contributor

ShogunPanda commented Aug 7, 2023

Yes, it was a typo on the test, I included in #239.
According to the specs (both RFC 9112 which the most recent and RFC 7230 which llhttp implements) , Content-Length "SHOULD NOT" be sent when Transfer-Encoding is present. If it still happens, the latter should override the former.
llhttp is a bit stricter on this and forbids (when non in lenient mode) the conflict without attempting to resolve it. The value of the headers doesn't matter, their mere presence is enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants