Unhandled Error : Process crashed with: TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Host"]
See original GitHub issueconst axios = require('axios')
;(async () => {
const url = "http://www.smun.spb.ru"
const head_response = await axios.head(url)
console.log(head_response.headers)
})()
.then(() => { console.log("Success")})
.catch(() => { console.log("Error")})
Throws this exception
Process crashed with: TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["Host"]
at validateHeader (_http_outgoing.js:506:11)
at ClientRequest.setHeader (_http_outgoing.js:510:3)
at new ClientRequest (_http_client.js:228:12)
at Object.request (http.js:41:10)
at RedirectableRequest._performRequest (/home/runner/node_modules/follow-redirects/index.js:158:24)
at RedirectableRequest._processResponse (/home/runner/node_modules/follow-redirects/index.js:249:10)
at ClientRequest.RedirectableRequest._onNativeResponse (/home/runner/node_modules/follow-redirects/index.js:39:10)
at Object.onceWrapper (events.js:272:13)
at ClientRequest.emit (events.js:180:13)
at HTTPParser.parserOnIncomingClient [as onIncoming] (_http_client.js:540:21)
Issue Analytics
- State:
- Created 5 years ago
- Comments:7
Top Results From Across the Web
Invalid character in header content ["Host"] Postman
I had the same error being reported for any forked or created Postman requests: Error: Invalid character in header content ["Host"].
Read more >Invalid character in header content [“Host”] Postman - Help
When i try to test api with localhost:[port] it gives the invalid character in header [“Host”] console error. I am using dotnet core...
Read more >TypeError: Invalid character in header content ["getKeyByValue"]
Hi,. When I'm setting a header in the http out, I get this fatal error. TypeError: Invalid character in header content ["getKeyByValue"].
Read more >Help resolving Invalid character in header content
Hi, I have a working slack app running as an Azure function using NodeJS. It is posting payloads fine to my channel.
Read more >Getting Invalid http header / Invalid Data when trying to GET
This GET works when I try it in Postman. But when I run the program, I get the error message below. This is...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@chinesedfan the problem is that incorrect server response crashes process, instead of rejecting promise.
Closed by #2689.