Skip to content
New issue

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

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

Already on GitHub? # to your account

Stricter parsing of status line #217

Merged
merged 1 commit into from
Feb 9, 2023

Conversation

emontnemery
Copy link
Contributor

Stricter parsing of status line

Background:
llhttp currently does not handle extra spaces in the status line correctly

This snippet:

HTTP/1.1  200  OK

Is parsed as status=0, v=1/1, reason = ' OK', which is clearly not correct.

This PR rejects a status line with more than one space between HTTP version and status code, and also requires that the status code is exactly 3 digits as per the relevant section on RFC7230 which says that a status line is:

status-line = HTTP-version SP status-code SP reason-phrase CRLF

Copy link
Contributor

@ShogunPanda ShogunPanda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

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

Successfully merging this pull request may close these issues.

2 participants