diff options
Diffstat (limited to 'django/core/handlers/asgi.py')
-rw-r--r-- | django/core/handlers/asgi.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/django/core/handlers/asgi.py b/django/core/handlers/asgi.py index 2aede079b9..39e2abe5a9 100644 --- a/django/core/handlers/asgi.py +++ b/django/core/handlers/asgi.py @@ -41,9 +41,9 @@ class ASGIRequest(HttpRequest): self._read_started = False self.resolver_match = None self.script_name = self.scope.get("root_path", "") - if self.script_name and scope["path"].startswith(self.script_name): + if self.script_name: # TODO: Better is-prefix checking, slash handling? - self.path_info = scope["path"][len(self.script_name) :] + self.path_info = scope["path"].removeprefix(self.script_name) else: self.path_info = scope["path"] # The Django path is different from ASGI scope path args, it should |