A rule for a value that goes into an HTTP header (User-Agent, defaultHeaders):
not blank, no control characters (a CR/LF or other C0 byte, DEL; tab is fine)
and no code units above U+00FF. That is what Node's HTTP layer accepts; anything
else it refuses with an opaque ERR_INVALID_CHAR, and a CR/LF handed to a custom
transport could inject a header. Checked by char code so the source stays free
of control bytes.
A rule for a value that goes into an HTTP header (User-Agent,
defaultHeaders): not blank, no control characters (a CR/LF or other C0 byte, DEL; tab is fine) and no code units above U+00FF. That is what Node's HTTP layer accepts; anything else it refuses with an opaqueERR_INVALID_CHAR, and a CR/LF handed to a custom transport could inject a header. Checked by char code so the source stays free of control bytes.