Skip to content

Commit c1e3a66

Browse files
committed
Only catch KeyError in HS token checker
1 parent 4032841 commit c1e3a66

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mautrix/appservice/as_handler.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,12 +84,12 @@ def _check_token(self, request: web.Request) -> bool:
8484
except KeyError:
8585
try:
8686
token = request.headers["Authorization"].removeprefix("Bearer ")
87-
except (KeyError, AttributeError):
88-
self.log.trace("No access_token nor Authorization header in request")
87+
except KeyError:
88+
self.log.debug("No access_token nor Authorization header in request")
8989
return False
9090

9191
if token != self.hs_token:
92-
self.log.trace(f"Incorrect hs_token in request ({token!r} != {self.hs_token!r})")
92+
self.log.debug(f"Incorrect hs_token in request")
9393
return False
9494

9595
return True

0 commit comments

Comments
 (0)