Add header normalization and fetching for hosting service HTTP support.
Review Request #11199 — Created Sept. 24, 2020 and submitted — Latest diff uploaded
We've had some annoyances with properly looking up headers from an HTTP
response in hosting service implementations in a consistent manner
across versions of Review Board, and across versions of Python. Work has
been done to fix this for GitHub, where this was more immediately
This change works to standardize how we store headers, both for requests
and responses, in the new hosting service HTTP implementation. We now
store all headers as lowercase, and normalize on lookup.
HostingServiceHTTPResponsenow has a
get_header()method, just like
HostingServiceHTTPRequest. This is now preferred over accessing
headersdirectly, and will handle normalization on the caller's
behalf. This is future-proof and avoids any further confusion around
Unit tests pass on Python 2.7 and 3.6 through 3.8.