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

Test and fix a regression in parsing partial requests in the 1.9.x series #176

Merged

Conversation

bearcage
Copy link
Contributor

@bearcage bearcage commented Jun 15, 2024

A regression was introduced in this bit of the SWAR changeset which manifests as incorrectly classifying a read() with the contents GET as a token error (because there's no characters yet to parse for the path part) rather than as an Ok(Status::Partial).

This diff is three independent commits to:

  1. Add specific regression tests covering this and similar situations
  2. Add a general regression test checking all permutations of a partial one-line request
  3. Fix the behavior of the parse_uri() function to disambiguate between an empty path followed by a space, versus a partial read that ends at the start of the path.

NB. This'll conflict with #175 — not in a material way, they'll work fine together, just a note.

@seanmonstar seanmonstar merged commit 55933eb into seanmonstar:master Jun 17, 2024
35 checks passed
lucab added a commit to lucab/httparse that referenced this pull request Sep 1, 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.

2 participants