Invalid header value char

Describe the issue/error/question

I have a XML API, but if i try this request with n8n, i will get the following error.
If i made the same request with curl i got a right response.

What is the error message (if any)?

ERROR: UNKNOWN ERROR - check the detailed error for more information
Invalid header value char

{“status”:“rejected”,“reason”:{“message”:“Parse Error: Invalid header value char”,“name”:“Error”,“stack”:“Error: Parse Error: Invalid header value char\n at TLSSocket.socketOnData (node:_http_client:534:22)\n at TLSSocket.emit (node:events:513:28)\n at TLSSocket.emit (node:domain:489:12)\n at addChunk (node:internal/streams/readable:315:12)\n at readableAddChunk (node:internal/streams/readable:289:9)\n at TLSSocket.Readable.push (node:internal/streams/readable:228:10)\n at TLSWrap.onStreamRead (node:internal/stream_base_commons:190:23)”,“code”:“HPE_INVALID_HEADER_TOKEN”}}

Please share the workflow

CURL Command:

curl --insecure -XPUT -H 'Content-Type: text/xml' -d '<request><uid>3000</uid><pwd>89vc8Dd87R</pwd></request>' '*/*/*/'

Information on your n8n setup

  • n8n version: 0.216.0
  • Database you’re using (default: SQLite): SQLite
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm,, desktop app]: Docker

Hey @ChristianV,

That is odd, It looks like the service is returning an invalid header but I can’t work out which one it is. I will need to do some more digging into this one to work it out.

@Jon , thanks for your reply, i tried it now with an own Node, with the old helpers.request and the new helpers.httpRequest both have the same problem.

But for your information, i have a Windows n8n Version installed in my Notebook, it is old version 0.182.0, but there it work without problem.

Hi @ChristianV

The HTTP request node makes use of those same helpers, of course. So that is to be expected that a custom node has the same issue. :slight_smile:

It is interesting that the older version does work, though.

@BramKn , no, if i install on docker the version 0.182.0, it also doesnt work.

I would expect it to fail as the data coming back is invalid somewhere, I still need to look into it properly but I think curl might not be as strict.

@Jon , after a while, i restarted the debugging on this error again, it looks like the nodejs/axions module have the problem, with the header parser.

There should be an options “NODE_OPTIONS=”–insecure-http-parser""(Header separator parsing prevent http request because of missing expected CR after header value · Issue #43798 · nodejs/node · GitHub) or (

But how can i add this option to n8n!? my n8n is running in docker.

I tried with ENV NODE_OPTIONS=“–insecure-http-parser” in Dockerfile, but the error still occurs!? But how i check, if this options grabs!?

OK it works now. Missed to restart docker image :weary:


This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.