Skip to content

Commit 518acbe

Browse files
fix quart url
1 parent 79cf430 commit 518acbe

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

sentry_sdk/integrations/quart.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
capture_internal_exceptions,
1818
ensure_integration_enabled,
1919
event_from_exception,
20+
package_version,
2021
)
2122

2223
if TYPE_CHECKING:
@@ -86,16 +87,23 @@ def setup_once() -> None:
8687
def patch_asgi_app() -> None:
8788
old_app = Quart.__call__
8889

90+
version = package_version("quart")
91+
8992
async def sentry_patched_asgi_app(
9093
self: "Any", scope: "Any", receive: "Any", send: "Any"
9194
) -> "Any":
92-
if sentry_sdk.get_client().get_integration(QuartIntegration) is None:
95+
if (
96+
sentry_sdk.get_client().get_integration(QuartIntegration) is None
97+
or version is None
98+
):
9399
return await old_app(self, scope, receive, send)
94100

95101
middleware = SentryAsgiMiddleware(
96102
lambda *a, **kw: old_app(self, *a, **kw),
97103
span_origin=QuartIntegration.origin,
98104
asgi_version=3,
105+
# https://github.com/pallets/quart/commit/7be545c
106+
path_includes_root_path=version >= (0, 19),
99107
)
100108
return await middleware(scope, receive, send)
101109

0 commit comments

Comments
 (0)