-
Notifications
You must be signed in to change notification settings - Fork 12
Open
Labels
area: headersIssues related to headers.Issues related to headers.enhancementNew feature or requestNew feature or request
Milestone
Description
Problem
The current WildcardListHeader<T> implementation strictly rejects mixing * with other values during both parsing and generation:
if (splitValues.length > 1 && splitValues.contains('*')) {
throw const FormatException('Wildcard (*) cannot be used with other values');
}While this prevents semantically meaningless combinations (e.g., Access-Control-Allow-Headers: *, Content-Type), it may be too strict for parsing headers from external sources.
Design Tension
Generation: We want to prevent creating semantically contradictory headers
Parsing: We want to handle syntactically valid but semantically questionable input gracefully
This follows the "be liberal in what you accept, conservative in what you send" principle.
Potential Solutions
- Separate validation paths: Allow mixed wildcards during parsing but prevent them during construction
- Parse permissively, expose conservatively: Parse everything but provide methods to detect/handle semantic issues
- Configuration-based: Make wildcard strictness configurable per header type
- Current approach: Stay strict on both sides (status quo)
Context
Discussion originated in PR #159 regarding the base class design for wildcard-enabled headers.
Backlinks:
Metadata
Metadata
Assignees
Labels
area: headersIssues related to headers.Issues related to headers.enhancementNew feature or requestNew feature or request
Type
Projects
Status
Backlog 🗂️