fix: allow empty HTTP header values - #15
Closed
Wfontesd wants to merge 1 commit into
Closed
Conversation
Owner
|
Close since it seems agent spam. Reopen only if you're not a bot. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HttpHeaders.ofrejects empty values and empty value lists, although the JDK accepts them. This prevents a valid empty header from being represented and makes an empty list fail instead of omitting that header.Remove the two extra restrictions. Values are still trimmed and passed to the caller's filter; null checks and header-name validation remain in place. Four tests cover empty strings, whitespace-only values, empty lists, and filtering empty values from a mixed list.
The three original regression probes pass on JDK 25.0.2 and fail on Native before the fix. All four final tests pass on the JDK. On Scala Native 0.5.12/Linux, all 35 tests across the new header/copy suites and existing HttpHeadersTest/HttpRequestTest suites pass with both independent fixes applied.
Fixed with the help of AI.
Would you consider US$35 via PayPal for accepting this focused fix? This is a proposed price, not an agreed bounty or a claim on the main requests-scala award. Payment details can be shared privately. This is separate from #10's immutable-list change and should compose with it.