Skip to content

fix: allow empty HTTP header values - #15

Closed
Wfontesd wants to merge 1 commit into
lqhuang:mainfrom
Wfontesd:fix/empty-header-values
Closed

fix: allow empty HTTP header values#15
Wfontesd wants to merge 1 commit into
lqhuang:mainfrom
Wfontesd:fix/empty-header-values

Conversation

@Wfontesd

@Wfontesd Wfontesd commented Sep 8, 2026

Copy link
Copy Markdown

HttpHeaders.of rejects 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.

@lqhuang

lqhuang commented Sep 8, 2026

Copy link
Copy Markdown
Owner

Close since it seems agent spam. Reopen only if you're not a bot.

@lqhuang lqhuang closed this Sep 8, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants