psr7 icon indicating copy to clipboard operation
psr7 copied to clipboard

bugfix: allow empty lists as header values

Open stobrien89 opened this issue 6 months ago • 0 comments

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 avatar Jun 16 '25 00:06 stobrien89