Add header normalization and fetching for hosting service HTTP support.
Review Request #11199 — Created Sept. 24, 2020 and submitted
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
noticed.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.
HostingServiceHTTPResponse
now has aget_header()
method, just like
HostingServiceHTTPRequest
. This is now preferred over accessing
headers
directly, and will handle normalization on the caller's
behalf. This is future-proof and avoids any further confusion around
headers.
Unit tests pass on Python 2.7 and 3.6 through 3.8.
- Change Summary:
-
Fixed a long line.
- Commits:
-
Summary ID 891c07beb0d2d61db97e4ce184bbaa0f94f069cb 97757595f1dde8a8ee7f606c0350e74d2170bcb3