Skip to content

obs-fold HTTP header fields are not parsed correctly #53185

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

Closed
brianquinlan opened this issue Aug 11, 2023 · 0 comments
Closed

obs-fold HTTP header fields are not parsed correctly #53185

brianquinlan opened this issue Aug 11, 2023 · 0 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-io

Comments

@brianquinlan
Copy link
Contributor

Dart 3.2

With folded headers, the RFC2616 says:

   HTTP/1.1 header field values can be folded onto multiple lines if the
   continuation line begins with a space or horizontal tab. All linear
   white space, including folding, has the same semantics as SP. A
   recipient MAY replace any linear white space with a single SP before
   interpreting the field value or forwarding the message downstream.

Existing tests verify incorrect behavior:

    request = """
POST /test HTTP/1.1\r
Header-A:   AA\r
 A\r
X-Header-B:           b\r
  b\r
\t    b\r
\r
""";

    headers = new Map();
    headers["header-a"] = "AAA";
    headers["x-header-b"] = "bbb";
    _testParseRequestLean(request, "POST", "/test", expectedHeaders: headers);

The correct header values should not have the middle whitespace stripped e.g.

    headers["header-a"] = "A A A";
    headers["x-header-b"] = "b b b";

Folded header values are obsolete according to RFC-7230 so maybe we should remove support for them?

@mkustermann mkustermann added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-io labels Aug 11, 2023
copybara-service bot pushed a commit that referenced this issue Sep 11, 2023
Bug: #53227
Bug: #53185
Change-Id: Ibbdbdf9c8f2875e8f687244982810fffee20e69c
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/320920
Commit-Queue: Brian Quinlan <[email protected]>
Reviewed-by: Alexander Aprelev <[email protected]>
@brianquinlan brianquinlan self-assigned this Sep 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-io
Projects
None yet
Development

No branches or pull requests

2 participants