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

httparse 1.9.x breaks header parsing for certain cases #173

Closed
mathpal opened this issue Jun 11, 2024 · 1 comment · Fixed by #174
Closed

httparse 1.9.x breaks header parsing for certain cases #173

mathpal opened this issue Jun 11, 2024 · 1 comment · Fixed by #174

Comments

@mathpal
Copy link

mathpal commented Jun 11, 2024

A bug in the latest release leads to header values being incorrectly parsed when there is no space between header-name and header-value (header-name:headervalue\r\n includes : in the header value).

example:

    let mut headers = [httparse::EMPTY_HEADER; 1];
    let mut response = httparse::Response::new(&mut headers[..]);
    response.parse(b"HTTP/1.0 200 OK\r\nfoo:bar\r\n\r\n").unwrap();
    println!("{:?}", headers);
[Header { name: "foo", value: ":bar" }]

a quick bisect shows that b2625f3 introduced the regression.

@mathpal mathpal changed the title httparse 1.9.2 breaks header parsing for certain cases httparse 1.9.x breaks header parsing for certain cases Jun 11, 2024
@seanmonstar
Copy link
Owner

Thanks for the report, PR at #174.

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