python-hyper / h2

HTTP/2 State-Machine based protocol implementation
https://h2.readthedocs.io/en/stable
MIT License
963 stars 151 forks source link

Handle header values with whitespace pragmatically. #1206

Closed tomchristie closed 4 years ago

tomchristie commented 4 years ago

Raised via https://github.com/encode/httpx/issues/632

Currently header values with trailing whitespace are causing a ProtocolError to be raised. This is technically correct, but pragmatically it'd probably be a good idea for hyper-h2 to handle the case, silently trimming the whitespace.

vmagamedov commented 4 years ago

Hi! Are you aware that you can control this behaviour using H2Configuration -> validate_inbound_headers?

tomchristie commented 4 years ago

Ah fantastic, thanks!