Fix HTTP requests with URLs that end with the host name (no slash following) and avoid allocations when writing the request header.