Patch Changes
createRequest()andcreateRequestListener()now validate the request host for every handler, including handlers that take no arguments. The effective host, whether it comes from thehostoption, a trustedForwardedorX-Forwarded-Hostheader, HTTP/2:authority, orHost, must be a hostname or bracketed IPv6 address with an optional port. Values with a path, query, fragment, userinfo, whitespace, or control characters, such asexample.com/../adminoruser@example.com, makecreateRequest()throw.createRequestListener()passes the error toonErrorand responds with400 Bad RequestunlessonErrorreturns a response. An invalid trustedX-Forwarded-Hostis rejected instead of falling back toHost. (#12331)