Skip to content

Commit d92d61f

Browse files
committed
Fix Python 3.8 compatibility
1 parent 0da6f45 commit d92d61f

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

mautrix/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
__version__ = "0.19.15"
1+
__version__ = "0.19.16"
22
__author__ = "Tulir Asokan <[email protected]>"
33
__all__ = [
44
"api",

mautrix/appservice/as_handler.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,9 @@ def _check_token(self, request: web.Request) -> bool:
8383
token = request.rel_url.query["access_token"]
8484
except KeyError:
8585
try:
86-
token = request.headers["Authorization"].removeprefix("Bearer ")
86+
token = request.headers["Authorization"]
87+
if token.startswith("Bearer "):
88+
token = token[len("Bearer "):]
8789
except (KeyError, AttributeError):
8890
self.log.trace("No access_token nor Authorization header in request")
8991
return False

0 commit comments

Comments
 (0)