Skip to content

fix(starlette): Stop duplicating scope["root_path"] in URLs#6579

Merged
alexander-alderman-webb merged 22 commits into
masterfrom
webb/asgi/double-mount-prefix
Jun 26, 2026
Merged

fix(starlette): Stop duplicating scope["root_path"] in URLs#6579
alexander-alderman-webb merged 22 commits into
masterfrom
webb/asgi/double-mount-prefix

fix quart url

518acbe
Select commit
Loading
Failed to load commit list.
@sentry/warden / warden: code-review completed Jun 19, 2026

2 issues

code-review: Found 2 issues (1 medium, 1 low)

Medium

Sentry monitoring silently disabled for all Quart requests when version is undetectable - `sentry_sdk/integrations/quart.py:94-98`

When package_version("quart") returns None, every request bypasses SentryAsgiMiddleware entirely with no warning or error, leaving the app completely unmonitored. Consider raising DidNotEnable at setup time (like starlette.py does) or falling back to a safe default for path_includes_root_path.

Low

test_request_url doesn't set root_path, so it doesn't validate the root_path deduplication fix - `tests/integrations/fastapi/test_fastapi.py:1050-1093`

The test uses the default empty root_path, so both the old (broken) and new code produce the same URL ("" + "/root/nomessage" = "/root/nomessage"). Consider passing root_path="/root" to TestClient and asserting the URL is http://testserver/root/nomessage, not http://testserver/root/root/nomessage. The Django ASGI test correctly does this with comm.scope["root_path"] = "/root".

Also found at:

  • tests/integrations/starlette/test_starlette.py:1507-1525
  • tests/integrations/quart/test_quart.py:703-707

⏱ 7m 4s · 2.7M in / 111.0k out · $3.89

Annotations

Check warning on line 98 in sentry_sdk/integrations/quart.py

See this annotation in the file changed.

@sentry-warden sentry-warden / warden: code-review

Sentry monitoring silently disabled for all Quart requests when version is undetectable

When `package_version("quart")` returns `None`, every request bypasses `SentryAsgiMiddleware` entirely with no warning or error, leaving the app completely unmonitored. Consider raising `DidNotEnable` at setup time (like `starlette.py` does) or falling back to a safe default for `path_includes_root_path`.