send auth token in headers

This commit is contained in:
git-bruh 2021-08-04 17:32:08 +05:30
parent 17ad06c503
commit 8607a402fa
No known key found for this signature in database
GPG key ID: E1475C50075ADCE6

View file

@ -188,8 +188,10 @@ class AppService(bottle.Bottle):
content_type: str = "application/json", content_type: str = "application/json",
endpoint: str = "/_matrix/client/r0", endpoint: str = "/_matrix/client/r0",
) -> dict: ) -> dict:
params["access_token"] = self.as_token headers = {
headers = {"Content-Type": content_type} "Authorization": f"Bearer {self.as_token}",
"Content-Type": content_type,
}
payload = json.dumps(content) if isinstance(content, dict) else content payload = json.dumps(content) if isinstance(content, dict) else content
endpoint = ( endpoint = (
f"{self.base_url}{endpoint}{path}?" f"{self.base_url}{endpoint}{path}?"