Skip to content

Conversation

@stobrien89
Copy link

@stobrien89 stobrien89 commented Jun 16, 2025

Closes #626

Description:

RFC 9110 (and its predecessors) do not forbid empty header field lists. While senders are explicitly prohibited from including empty list elements (e.g., consecutive commas), an entire list may be empty — as long as the field's grammar permits it (i.e., it's defined using #element, not 1#element).

This change removes the empty list validation in normalizeHeaderValue() and adds tests on the Request and Response construction paths.

@stobrien89 stobrien89 force-pushed the bugfix-empty-list-header-value branch from 4f8981c to 3cb0a91 Compare June 16, 2025 00:51
@GrahamCampbell GrahamCampbell changed the title bugfix: allow empty lists as header values Allow empty lists as header values Aug 21, 2025
@GrahamCampbell GrahamCampbell changed the base branch from 2.7 to 2.8 August 21, 2025 12:00
@GrahamCampbell GrahamCampbell changed the title Allow empty lists as header values [2.8] Allow empty lists as header values Aug 21, 2025
@GrahamCampbell GrahamCampbell merged commit 893e271 into guzzle:2.8 Aug 22, 2025
21 checks passed
@stobrien89
Copy link
Author

Thanks @GrahamCampbell!

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.

MessageTrait's normalizeValue() incorrectly rejects empty lists

2 participants