The statusCode is not correctly set when the request is piped. The writeHead method sets the statusCode internally, but when the request is piped, the statusCode is not updated in the response.
Expected Behavior
The statusCode should be correctly set in the response when the request is piped, reflecting the value set using the writeHead method.
I have identified a potential solution to address the issue. In the HttpResponse class of the low-http-server library, within the writeAllHeaders method, I suggest making the following modification:
Issue Description
Current Behavior
The
statusCode
is not correctly set when the request is piped. ThewriteHead
method sets thestatusCode
internally, but when the request is piped, thestatusCode
is not updated in the response.Expected Behavior
The
statusCode
should be correctly set in the response when the request is piped, reflecting the value set using thewriteHead
method.Steps to Reproduce
low-http-server
.statusCode
using thewriteHead
method.statusCode
in the response.Code Example
Solution Proposal
I have identified a potential solution to address the issue. In the
HttpResponse
class of thelow-http-server
library, within thewriteAllHeaders
method, I suggest making the following modification:Additional Information