flake8
-
reviewboard/hostingsvcs/service.py (Diff revision 1) Show all issues
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.
Fixed a long line.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 2 (+168 -22) |
Great work!
reviewboard/hostingsvcs/tests/test_client.py (Diff revision 2) |
---|
The first and third Authorization header tests are the same test.
The Content-length header tests are the same too.
Let me know if this is done on purpose.
Fixed some bad variations on HTTP headers in the unit tests.
Commits: |
|
|||||||
---|---|---|---|---|---|---|---|---|
Diff: |
Revision 3 (+168 -22) |