The header formatter promises to preserve the relative order of repeated fields, but sorting is case-sensitive. Given:
HTTP/1.1 200 OK
set-cookie: first=1
X-Z: last
Set-Cookie: second=2
accept: text/plain
the formatter moves Set-Cookie: second=2 before set-cookie: first=1. HTTP field names are case-insensitive, so these are repeated fields and their display order should remain unchanged. Case-sensitive sorting also places X-Z before accept.
Expected accept first, then both cookie lines in original order, then X-Z, preserving original spelling and values. Reproduced on master with Python 3.12.13, macOS. Prepared with Codex assistance.
The header formatter promises to preserve the relative order of repeated fields, but sorting is case-sensitive. Given:
the formatter moves
Set-Cookie: second=2beforeset-cookie: first=1. HTTP field names are case-insensitive, so these are repeated fields and their display order should remain unchanged. Case-sensitive sorting also places X-Z before accept.Expected accept first, then both cookie lines in original order, then X-Z, preserving original spelling and values. Reproduced on master with Python 3.12.13, macOS. Prepared with Codex assistance.