You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
_http_outgoing.js:465
throw err;
^
TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["set-cookie"]
at ServerResponse.setHeader (_http_outgoing.js:474:3)
at ClientRequest.getHttp.request.on.destResp (/app.js:77:8)
at ClientRequest.emit (events.js:182:13)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:546:21)
at HTTPParser.parserOnHeadersComplete (_http_common.js:109:17)
at TLSSocket.socketOnData (_http_client.js:432:20)
at TLSSocket.emit (events.js:182:13)
at addChunk (_stream_readable.js:283:12)
at readableAddChunk (_stream_readable.js:264:11)
at TLSSocket.Readable.push (_stream_readable.js:219:10)
Presumably it's \u0001 , is identified an unicode? That's not my server response headers, so it's being served for a long time and others server are accepting it without any issues... So why node.js is not willing to accept that one when i'm trying to proxy request further by setting it via .setHeader() ?
I have an image proxy built with node js that throws this error every couple of minutes and I cannot find a way to handle this error. Does anyone have a solution for this ?
Activity
bnoordhuis commentedon Jun 24, 2018
The
\u0001turns into a control character when encoded to ASCII or UTF-8 and those are rejected as a security measure. That's working as expected.TheHanna commentedon Aug 13, 2018
For anyone else that comes across this issue:
The cookies are coming from Imperva's Incapsula product. You can request that they not inject those cookies by reaching out to their support team.
nkostadinov commentedon Nov 20, 2018
I have an image proxy built with node js that throws this error every couple of minutes and I cannot find a way to handle this error. Does anyone have a solution for this ?
gajus commentedon Aug 8, 2019
I have documented a solution in this thread.
#22064 (comment)