Bug Report
Summary
HTTP/Response::getHeaders() returns header like key:<space>value even when the header sent by application is key:value .
HTTP spec says :
https://www.rfc-editor.org/rfc/rfc9110.html#name-whitespace
The OWS rule is used where zero or more linear whitespace octets might appear. For protocol elements where optional whitespace is preferred to improve readability, a sender SHOULD generate the optional whitespace as a single SP; otherwise, a sender SHOULD NOT generate optional whitespace except as needed to overwrite invalid or unwanted protocol elements during in-place message filtering
.
Current behavior
sendResponse(method, requestTarget, resOrStream, 200, JSON.stringify(incomingHeaders2, null, 2), {
'Content-Type': 'application/json',
'X-Response-Header-Downstream-To-App': 'Value 3',
});
}
However when reading headers from laminas/API/response::getHeaders() , I received the headers like:
'Content-Type': 'application/json',
'X-Response-Header-To-App': 'Value 3'
How to reproduce
Any node js application which sends header in above format and laminas application received the requests and print headers.
Expected behavior
headers should propagated as it is what framework received.
Bug Report
Summary
HTTP/Response::getHeaders() returns header like
key:<space>valueeven when the header sent by application iskey:value.HTTP spec says :
https://www.rfc-editor.org/rfc/rfc9110.html#name-whitespace
.
Current behavior
However when reading headers from laminas/API/response::getHeaders() , I received the headers like:
How to reproduce
Any node js application which sends header in above format and laminas application received the requests and print headers.
Expected behavior
headers should propagated as it is what framework received.