Respond with 414 when a line exceeds the maximum line length - #238
Open
trevorturk wants to merge 1 commit into
Open
Respond with 414 when a line exceeds the maximum line length#238trevorturk wants to merge 1 commit into
trevorturk wants to merge 1 commit into
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #237.
Previously, when a request line or header line exceeded
maximum_line_length,LineLengthErrorpropagated pastnext_request(it doesn't include theBadRequestmarker), so the server closed the connection without writing anything and the peer saw an unexplained EOF.This PR rescues
LineLengthErrorinnext_requestand uses the existingfail_requestpath to respond with 414 before re-raising, matching the existingBadRequest→ 400 handling. The request-line and header-line cases can't be distinguished at the rescue site, so both get 414 as the more common case — happy to split the error by phase in protocol-http1 and map 414/431 instead if you'd prefer that precision.Types of Changes
Contribution