-
Notifications
You must be signed in to change notification settings - Fork 629
fix(asgi): Stop duplicating scope["root_path"] in URLs
#6579
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
255fcee
89023f4
a58e42d
42aca21
ad1d00f
539b1cd
a7112ba
574b5e5
e7c7fab
79cf430
518acbe
b420587
eda0dec
dc3d352
a96d284
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -11,6 +11,7 @@ | |
| import inspect | ||
| from typing import TYPE_CHECKING | ||
|
|
||
| from django import VERSION as DJANGO_VERSION | ||
| from django.core.handlers.wsgi import WSGIRequest | ||
|
|
||
| import sentry_sdk | ||
|
|
@@ -96,6 +97,10 @@ | |
| unsafe_context_data=True, | ||
| span_origin=DjangoIntegration.origin, | ||
| http_methods_to_capture=integration.http_methods_to_capture, | ||
| # From Django 5.1 onwards, ASGI request.path is taken directly from scope["path"] without prepending scope["root_path"]. | ||
| # Assume that scope["path"] includes scope["root_path"] for these versions, as otherwise request.path is also incorrect. | ||
| # https://github.com/django/django/commit/bcd255cd5ca0a1e686d276cca71f45ec400d84a2 | ||
| path_includes_root_path=DJANGO_VERSION >= (5, 1), | ||
|
Check warning on line 103 in sentry_sdk/integrations/django/asgi.py
|
||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Channels middleware missing path flagMedium Severity The Channels (<3) Reviewed by Cursor Bugbot for commit a96d284. Configure here.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test_request_url fails on Django < 5.1 due to incorrect root_path setup The new Evidence
Also found at 1 additional location
Identified by Warden code-review · GNZ-9Q4 |
||
| )._run_asgi3 | ||
|
|
||
| return await middleware(scope, receive, send) | ||
|
|
||


Uh oh!
There was an error while loading. Please reload this page.