Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Edit SimpleHttpClient to reference that header keys can be passed as str or bytes #6077

Merged
merged 5 commits into from Sep 27, 2019

Conversation

@anoadragon453
Copy link
Member

anoadragon453 commented Sep 20, 2019

Header dicts should have bytes as the key in the headers dict, not a str.

@anoadragon453 anoadragon453 self-assigned this Sep 20, 2019
@anoadragon453 anoadragon453 added this to In progress in Homeserver Task Board via automation Sep 20, 2019
@anoadragon453 anoadragon453 requested a review from matrix-org/synapse-core Sep 20, 2019
@neilisfragile neilisfragile moved this from In progress to Review in Homeserver Task Board Sep 20, 2019
@@ -0,0 +1 @@
Ensure header dicts passed to SimpleHttpClient using `bytes` instead of `str` for keys.

This comment has been minimized.

Copy link
@richvdh

richvdh Sep 23, 2019

Member

this should match the PR which introduced the bug (#5976)

Copy link
Member

richvdh left a comment

I'm not quite sure what this is for. AFAIK the SimpleHttpClient methods accept either str or bytes for both the header name and the values

Certainly the docstring isn't clear about this, and I wouldn't be hugely averse to us doing a bit of a cleanup on it - but (a) it seems odd to change the header name and not the value, and (b) just changing one header name instance doesn't seem to achieve much.

@anoadragon453 anoadragon453 changed the title Ensure headers passed to SimpleHttpClient are bytes Edit SimpleHttpClient to reference that header keys can be passed as str or bytes Sep 26, 2019
@anoadragon453

This comment has been minimized.

Copy link
Member Author

anoadragon453 commented Sep 26, 2019

I've updated the PR to only edit the docstrings now, as I think that would've saved me from this confusion.

synapse/http/client.py Outdated Show resolved Hide resolved
changelog.d/6077.bugfix Outdated Show resolved Hide resolved
synapse/handlers/room_member.py Outdated Show resolved Hide resolved
Copy link
Member

richvdh left a comment

lgtm

@anoadragon453 anoadragon453 merged commit f345111 into develop Sep 27, 2019
19 checks passed
19 checks passed
buildkite/synapse Build #4663 passed (15 minutes, 54 seconds)
Details
buildkite/synapse/check-sample-config Passed (1 minute, 39 seconds)
Details
buildkite/synapse/check-style Passed (1 minute, 18 seconds)
Details
buildkite/synapse/isort Passed (20 seconds)
Details
buildkite/synapse/mypy Passed (23 seconds)
Details
buildkite/synapse/newspaper-newsfile Passed (17 seconds)
Details
buildkite/synapse/packaging Passed (19 seconds)
Details
buildkite/synapse/pipeline Passed (9 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-postgres-9-dot-5 Passed (11 minutes, 24 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite Passed (4 minutes, 19 seconds)
Details
buildkite/synapse/python-3-dot-5-slash-sqlite-slash-old-deps Passed (6 minutes, 42 seconds)
Details
buildkite/synapse/python-3-dot-6-slash-sqlite Passed (4 minutes, 14 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-11 Passed (12 minutes, 1 second)
Details
buildkite/synapse/python-3-dot-7-slash-postgres-9-dot-5 Passed (11 minutes, 34 seconds)
Details
buildkite/synapse/python-3-dot-7-slash-sqlite Passed (4 minutes)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-postgres-9-dot-6-slash-monolith Passed (9 minutes, 37 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-postgres-9-dot-6-slash-workers Passed (9 minutes, 15 seconds)
Details
buildkite/synapse/sytest-python-3-dot-5-slash-sqlite-slash-monolith Passed (8 minutes, 49 seconds)
Details
buildkite/synapse/trigger-webhook Passed (8 seconds)
Details
Homeserver Task Board automation moved this from Review to Done Sep 27, 2019
@anoadragon453 anoadragon453 deleted the anoa/make_headers_bytes branch Sep 27, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
2 participants
You can’t perform that action at this time.