This makes the host http header have the port if and only if the URI provided by the API user included it. Closes #19624