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

forbid use of bare LF as chunk header terminator #82

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

kazuho
Copy link
Member

@kazuho kazuho commented Jan 31, 2024

As discussed in #60, RFC 9112 mandates use of CRLF (i.e., forbids use of bare LF) at the end of chunk headers.

This pull request enforces that.

At the same time it continues to accept bare LF inside trailers, as it is a list of fields and RFC 9112 allows parsers to accept bare LFs at the end of each field. This behavior might not be necessary, but it retains consistency with phr_parse_headers which is the function that is used for parsing trailers (note: it is only when consume_trailer bit is set that the trailers are consumed by phr_decode_chunked; if the flag is not, it is the responsibility of the application to parse the trailers using phr_parse_headers).

@kazuho kazuho changed the title Kazuho/bare lf in chunk header forbid use of bare LF as chunk header terminator Jan 31, 2024
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 this pull request may close these issues.

1 participant