I think you'll have to do the same thing with clientHead on line 127 in chain.ts as well, for completeness.
That's from upstream proxies. I don't think in a real case scenario this would ever come from a server, because after the connection is established, the data is sent in another packet, therefore it should be not possible for this to occur. I remember there was a case where the upstream proxy sent a valid HTTP response (non-200 however) to a CONNECT.
I guess you're after backwards compatibility, so I have done that change.
That's from upstream proxies. I don't think in a real case scenario this would ever come from a server, because after the connection is established, the data is sent in another packet, therefore it should be not possible for this to occur. I remember there was a case where the upstream proxy sent a valid HTTP response (non-200 however) to a CONNECT.
I guess you're after backwards compatibility, so I have done that change.