Skip to content

Commit 903bbdd

Browse files
authored
Fix unhandled requests counted in blacksheep 2.4.4 (#186)
* Fix BlackSheep middleware for unhandled requests * Add comment
1 parent f8adf0d commit 903bbdd

File tree

2 files changed

+98
-22
lines changed

2 files changed

+98
-22
lines changed

apitally/blacksheep.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,10 @@ async def __call__(self, request: Request, handler: Callable[[Request], Awaitabl
171171
response_headers = Headers()
172172
response_body = b""
173173

174+
# Route pattern is "*" if the request doesn't match any route since v2.4.4
175+
if route_pattern == "*":
176+
route_pattern = None
177+
174178
if self.capture_request_body and RequestLogger.is_supported_content_type(request_content_type):
175179
if request_size is not None and request_size > MAX_BODY_SIZE:
176180
request_body = BODY_TOO_LARGE

0 commit comments

Comments
 (0)