python-hyper / h11

A pure-Python, bring-your-own-I/O implementation of HTTP/1.1
https://h11.readthedocs.io/
MIT License
490 stars 62 forks source link

On recoverable protocol errors from real-world usage. #96

Closed tomchristie closed 4 years ago

tomchristie commented 4 years ago

Figured I'd raise this based on some useful real world feedback in https://github.com/encode/httpx/issues/767 which includes a bunch of cases that urllib3 deals with, but h11 (correctly) identifies as protocol errors.

There's four seperate classes of protocol errors mentioned in that ticket...

  1. Multiple Content-Length headers. (Already covered by #92)
  2. Status code outside of valid range. (Returned a "600")
  3. "malformed data" - I believe triggered by a Server: header with no value.
  4. "Receive buffer too long" - Presumably an oversized header or similar but cause wasn't immediately clear.

I'm wondering if you've any thoughts on what (if anything) we might usefully do to have h11 be able to be lenient to some of these protocol errors?

Purely based on the feedback in that particular ticket, and given that #92 already covers one of the cases...

tomchristie commented 4 years ago

Apologies, I just noticed that #95 was already filed here.