node-http-proxy icon indicating copy to clipboard operation
node-http-proxy copied to clipboard

header could be empty string

Open damiandragowski opened this issue 4 years ago • 0 comments
trafficstars

changing condition, do setHeader only when header is not

null undefined NaN empty string ("") 0 false

It preserve from exception:

[HPM] GET /events?uuids=18cd56cb-45cb-43e6-a397-c4531cc57866 -> http://localhost:8099 _http_outgoing.js:545 throw new ERR_INVALID_HTTP_TOKEN('Header name', name); ^

TypeError [ERR_INVALID_HTTP_TOKEN]: Header name must be a valid HTTP token [""] at ServerResponse.setHeader (_http_outgoing.js:563:3)

damiandragowski avatar Sep 10 '21 07:09 damiandragowski