Why value cannot be sent as an HTTP header value (userAgent, a defaultHeaders
value), or undefined when it can: it must be a non-blank string with no control
character other than tab (a CR/LF would inject a header into a custom transport)
and no DEL, and nothing above U+00FF. Node's HTTP layer refuses those at request
time with a raw TypeError ("Invalid character in header content"). The engine
enforces it, and the CLI's --user-agent parser calls it. Checked by char code so
the source stays free of control bytes.
Why
valuecannot be sent as an HTTP header value (userAgent, adefaultHeadersvalue), or undefined when it can: it must be a non-blank string with no control character other than tab (a CR/LF would inject a header into a custom transport) and no DEL, and nothing above U+00FF. Node's HTTP layer refuses those at request time with a rawTypeError("Invalid character in header content"). The engine enforces it, and the CLI's--user-agentparser calls it. Checked by char code so the source stays free of control bytes.