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

header_io.ml''s parse doesn't support multi-line "folded" headers #1033

Open
askvortsov1 opened this issue Jun 5, 2024 · 1 comment · May be fixed by #1038
Open

header_io.ml''s parse doesn't support multi-line "folded" headers #1033

askvortsov1 opened this issue Jun 5, 2024 · 1 comment · May be fixed by #1038

Comments

@askvortsov1
Copy link

The HTTP 1.1 spec allows for header values to be split across several lines:

HTTP/1.1 header field values can be folded onto multiple lines if the
continuation line begins with a space or horizontal tab. All linear
white space, including folding, has the same semantics as SP. A
recipient MAY replace any linear white space with a single SP before
interpreting the field value or forwarding the message downstream.

For example:

Header: value1, value2

should be parsed equivalently to:

Header: value1,
        value2

This has since been deprecated except for use within the message/http media type, but this occasionally pops up in the wild, and other HTTP header parsers support it according to this StackOverflow answer.

@dinosaure
Copy link
Member

Note that unstrctrd was made for this specific purpose which concerns emails too.

@husong998 husong998 linked a pull request Jun 18, 2024 that will close this issue
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