hypercorn
hypercorn copied to clipboard
h11 protocol surfaces 431 (request headers too large) as 400 without logging
We had a tough time trying to debug an issue where our stack was 400ing without telemetry. We were able to trace it back to our large headers putting us over the h11_max_incomplete_size so the request was being rejected in hypercorn before making it to our FastAPI backend.
I think it would be best to punch through the 431 coming out of h11 as well as emit a log here. I went with an info-level log since this could be a client error (at least in this case it is). Definitely open to feedback or other ideas on that!
Proposed fix in https://github.com/pgjones/hypercorn/pull/156!