Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Send headers as a list
Browse files Browse the repository at this point in the history
  • Loading branch information
David Robertson committed Oct 26, 2022
1 parent 9726e23 commit 64e200a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions synapse/appservice/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ async def query_user(self, service: "ApplicationService", user_id: str) -> bool:
response = await self.get_json(
uri,
{"access_token": service.hs_token},
headers={"Authorization": f"Bearer {service.hs_token}"},
headers={"Authorization": [f"Bearer {service.hs_token}"]},
)
if response is not None: # just an empty json object
return True
Expand All @@ -147,7 +147,7 @@ async def query_alias(self, service: "ApplicationService", alias: str) -> bool:
response = await self.get_json(
uri,
{"access_token": service.hs_token},
headers={"Authorization": f"Bearer {service.hs_token}"},
headers={"Authorization": [f"Bearer {service.hs_token}"]},
)
if response is not None: # just an empty json object
return True
Expand Down Expand Up @@ -190,7 +190,9 @@ async def query_3pe(
b"access_token": service.hs_token,
}
response = await self.get_json(
uri, args=args, headers={"Authorization": f"Bearer {service.hs_token}"}
uri,
args=args,
headers={"Authorization": [f"Bearer {service.hs_token}"]},
)
if not isinstance(response, list):
logger.warning(
Expand Down Expand Up @@ -230,7 +232,7 @@ async def _get() -> Optional[JsonDict]:
info = await self.get_json(
uri,
{"access_token": service.hs_token},
headers={"Authorization": f"Bearer {service.hs_token}"},
headers={"Authorization": [f"Bearer {service.hs_token}"]},
)

if not _is_valid_3pe_metadata(info):
Expand Down Expand Up @@ -327,7 +329,7 @@ async def push_bulk(
uri=uri,
json_body=body,
args={"access_token": service.hs_token},
headers={"Authorization": f"Bearer {service.hs_token}"},
headers={"Authorization": [f"Bearer {service.hs_token}"]},
)
if logger.isEnabledFor(logging.DEBUG):
logger.debug(
Expand Down

0 comments on commit 64e200a

Please sign in to comment.