seanmonstar / httparse

A push parser for the HTTP 1.x protocol in Rust.
https://docs.rs/httparse
Apache License 2.0
573 stars 113 forks source link

multiline headers not handled #37

Closed durin42 closed 2 years ago

durin42 commented 7 years ago

While RFC 7230 deprecated mutliline headers (search around for obs-fold in the RFC, they're still something you sometimes encounter. I noticed this while using the multipart_mime library, which in turn uses httparse to handle headers in a MIME message. Here's a failing test case:

    req! {
        test_multiline_header,
        b"GET / HTTP/1.1\r\nX-Received: by 10.84.217.214 with SMTP id whatever;\r\n        Wed, 21 Jun 2017 09:04:21 -0700 (PDT)",
        |req| {
            assert_eq!(req.headers.len(), 1);
        }
    }

I'm not sure how to actually fix the issue, but I figured I'd at least report the bug.

tari commented 2 years ago

This seems like a duplicate of #68 (of perhaps that one is a duplicate of this, but the newer bug has a response); line folding is not (currently?) supported because of its complexity.