Skip to content

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

@mathpal

Description

@mathpal

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions