h11 icon indicating copy to clipboard operation
h11 copied to clipboard

Possibly we should allow HTTP/1.1 CONNECT requests without a Host: header

Open njsmith opened this issue 5 years ago • 2 comments

According to the spec, all HTTP/1.1 requests MUST have a Host: header. Currently h11 enforces this.

@jab pointed me to this issue that go ran into in 2017 trying to enforce this, where apparently some widespread apps (like Facebook on iOS) do HTTP/1.1 CONNECT without a Host: header: https://github.com/golang/go/issues/18215

It's not entirely clear if this is still relevant 3 years later, but since it's an obscure issue I wanted to make a note somewhere so we can (at the least) find it later.

njsmith avatar Sep 30 '20 20:09 njsmith

(slightly unrelated). I think the 'Request' class should take a 'host' parameter and include the header automatically. The library anyways checks for it and raises exception, so why not get the host and add the header automatically?

balki avatar Mar 19 '21 22:03 balki

@balki probably better to open a separate issue for that as it's entirely orthogonal to this issue

sigmavirus24 avatar Mar 21 '21 11:03 sigmavirus24