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

Weird header parsing in 1.9 #172

Closed
Tpt opened this issue Jun 11, 2024 · 2 comments · Fixed by #174 · May be fixed by #175
Closed

Weird header parsing in 1.9 #172

Tpt opened this issue Jun 11, 2024 · 2 comments · Fixed by #174 · May be fixed by #175

Comments

@Tpt
Copy link

Tpt commented Jun 11, 2024

Thank you so much for httparse all your other amazing libraries.

Sorry for the maybe bad bug report, I am not a HTTP expert.

With the new 1.9 version I get a test regression in oxhttp with strange parsing result. A : gets included in one of the header value.

Here is a test to reproduce the possible regression:

    #[test]
    fn test_http_parse() {
        let mut headers = [httparse::EMPTY_HEADER; 1024];
        let mut parsed_request = httparse::Request::new(&mut headers);
        parsed_request
            .parse(b"POST / HTTP/1.1\ncontent-length:4\n\n")
            .unwrap();
        for header in parsed_request.headers {
            if header.name == "content-length" {
                assert_eq!(header.value, b"4"); // Fails, we get ':4'
            }
        }
    }

Thank you again for your library.

@seanmonstar
Copy link
Owner

Thanks for the report, PR at #174.

@Tpt
Copy link
Author

Tpt commented Jun 12, 2024

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants