When attempting to set http headers with invalid characters, Nodejs will throw a TypeError.
node:_http_outgoing:628
throw new ERR_INVALID_CHAR('header content', name);
^
TypeError [ERR_INVALID_CHAR]: Invalid character in header content ["CF-Region"]
at ServerResponse.setHeader (node:_http_outgoing:651:3)
at Server.<anonymous> (/Users/kevin.he/dev/nodehttpheader/index.js:5:7)
at Server.emit (node:events:517:28)
at parserOnIncoming (node:_http_server:1107:12)
at HTTPParser.parserOnHeadersComplete (node:_http_common:119:17) {
code: 'ERR_INVALID_CHAR'
}