Skip to content

Commit 576d66b

Browse files
committed
Add method checking for ratelimits.
1 parent 368109d commit 576d66b

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

starlette_plus/middleware/ratelimiter.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,8 @@ async def __call__(self, scope: Scope, receive: Receive, send: Send) -> None:
7474
route: Route | None = None
7575

7676
for r in routes:
77-
if r.path == request.url.path:
77+
methods: set[str] = r.methods or set()
78+
if r.path == request.url.path and request.method in methods:
7879
route = r
7980
break
8081

0 commit comments

Comments
 (0)