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

make parseRFC5322Header more tolerant on input #2362

Merged
merged 1 commit into from
Dec 5, 2019

Conversation

tchaloupka
Copy link
Contributor

This makes HTTP header parser more tolerant to invalid inputs in regards to line separators.

The line terminator for message-header fields is the sequence CRLF. However, we recommend that applications, when parsing such headers, recognize a single LF as a line terminator and ignore the leading CR.

See https://www.w3.org/Protocols/rfc2616/rfc2616-sec19.html#sec19.3 for more details.

My problem is again Axis device with some CGI scripts returning something like:

HTTP/1.1 200 OK<CR><LF>
Date: Fri, 30 Aug 2019 15:59:02 GMT<CR><LF>
Accept-Ranges: bytes<CR><LF>
Connection: close<CR><LF>
Content-type: text/plain<LF><LF>

<body>

Which fails with strict parser.

@s-ludwig s-ludwig merged commit a9487b9 into vibe-d:master Dec 5, 2019
@tchaloupka tchaloupka deleted the tolerant_header_parser branch December 5, 2019 10:49
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.

2 participants