-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
area: headersIssues related to headers.Issues related to headers.bugSomething isn't workingSomething isn't working
Milestone
Description
Problem
The current HTTP header parsing implementation in the codebase uses naive string splitting methods that fail when quoted values contain delimiter characters. This affects the ForwardedHeader implementation and potentially other header parsers.
Example Issue
A header value like:
for="[2001:db8:cafe::17]:4711";desc="semi;colon"
Will be incorrectly parsed because the simple split(';') and split('=') methods don't respect quoted strings and escapes.
Current Implementation
The parsing uses:
final pairStrings = elementStr.split(';');
final parts = pairStr.split('=');Suggested Solutions
Reuse<-- no such thingHeaderValue.parsefrompackage:http_parser- Implement a custom state machine that properly handles quoted strings and escapes
- Use a proper HTTP header parser that respects RFC standards
Impact
This is a broader architectural issue that could affect multiple header types beyond just the Forwarded header.
References
- Original discussion: feat: Typed forwarded header #101 (comment)
- Related PR: feat: Typed forwarded header #101
Metadata
Metadata
Assignees
Labels
area: headersIssues related to headers.Issues related to headers.bugSomething isn't workingSomething isn't working
Type
Projects
Status
Backlog 🗂️