Skip to content

Commit 697c471

Browse files
Merge pull request #47 from mdsol/revert-rootpath-change
Revert including ASGI root_path in url to validate
2 parents 7381959 + a963175 commit 697c471

File tree

5 files changed

+99
-81
lines changed

5 files changed

+99
-81
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
# 1.6.3
2+
- Revert change introduced in v1.6.2 now that Starlette has been updated to
3+
always include `root_path` in `path`.
4+
15
# 1.6.2
26
- Fix `MAuthASGIMiddleware` signature validation when the full URL path is split
37
between `root_path` and `path` in the request scope.

mauth_client/middlewares/asgi.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,8 @@ async def __call__(
3838
if scope["type"] != "http" or path in self.exempt:
3939
return await self.app(scope, receive, send)
4040

41-
root_path = scope["root_path"]
4241
query_string = scope["query_string"]
43-
url = f"{root_path}{path}?{decode(query_string)}" if query_string else f"{root_path}{path}"
42+
url = f"{path}?{decode(query_string)}" if query_string else path
4443
headers = {decode(k): decode(v) for k, v in scope["headers"]}
4544

4645
events, body = await self._get_body(receive)

0 commit comments

Comments
 (0)