Skip to content

Commit ddc6543

Browse files
.
1 parent 66d2dde commit ddc6543

File tree

3 files changed

+4
-3
lines changed

3 files changed

+4
-3
lines changed

sentry_sdk/integrations/starlette.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -668,7 +668,7 @@ async def extract_request_info(self):
668668
and "sentry_sdk.is_body_cached" in self.request.scope["state"]
669669
and self.request.scope["state"]["sentry_sdk.is_body_cached"]
670670
)
671-
if await self.request.is_disconnected() and not is_body_cached:
671+
if not is_body_cached:
672672
request_info["data"] = (
673673
AnnotatedValue.removed_because_body_consumed_and_not_cached()
674674
)

tests/integrations/fastapi/test_fastapi.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import asyncio
12
import json
23
import logging
34
import pytest
@@ -86,7 +87,7 @@ async def _consume_stream_body(request):
8687
# Avoid cache by constructing new request
8788
wrapped_request = Request(request.scope, request.receive)
8889

89-
assert await wrapped_request.json() == BODY_JSON
90+
assert await asyncio.wait_for(wrapped_request.json(), timeout=1.0) == BODY_JSON
9091

9192
return {"status": "ok"}
9293

tests/integrations/starlette/test_starlette.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -518,7 +518,7 @@ async def _consume_stream_body(request):
518518
# Avoid cache by constructing new request
519519
wrapped_request = Request(request.scope, request.receive)
520520

521-
assert await wrapped_request.json() == BODY_JSON
521+
assert await asyncio.wait_for(wrapped_request.json(), timeout=1.0) == BODY_JSON
522522

523523
return starlette.responses.JSONResponse({"status": "ok"})
524524

0 commit comments

Comments
 (0)