[Django] #35354: Simplify ASGIRequest path handling.

13 views
Skip to first unread message

Django

unread,
Apr 5, 2024, 4:24:31 AM4/5/24
to django-...@googlegroups.com
#35354: Simplify ASGIRequest path handling.
------------------------------------------------+--------------------------
Reporter: Carlton Gibson | Owner: nobody
Type: Cleanup/optimization | Status: assigned
Component: HTTP handling | Version: 5.0
Severity: Normal | Keywords: asgi
Triage Stage: Unreviewed | Has patch: 1
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
------------------------------------------------+--------------------------
Following the ASGI HTTP Connection Scope docs[0], the provided `path` is
already the correct value that Django requires.

In combination with `root_path`, from which `script_name` is derived, the
`path_info` variable can is set.
It's then redundant to re-calculate `path` from `script_name` and
`path_info`.

See also, a clarifying discussion on the ASGIref repo[1].

[0]: https://asgi.readthedocs.io/en/latest/specs/www.html#http-connection-
scope
[1]: https://github.com/django/asgiref/issues/424
--
Ticket URL: <https://code.djangoproject.com/ticket/35354>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Apr 5, 2024, 4:26:10 AM4/5/24
to django-...@googlegroups.com
#35354: Simplify ASGIRequest path handling.
-------------------------------------+-------------------------------------
Reporter: Carlton Gibson | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: assigned
Component: HTTP handling | Version: 5.0
Severity: Normal | Resolution:
Keywords: asgi | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* owner: nobody => Carlton Gibson

Comment:

[https://github.com/django/django/pull/18050 PR]
--
Ticket URL: <https://code.djangoproject.com/ticket/35354#comment:1>

Django

unread,
Apr 5, 2024, 4:26:48 AM4/5/24
to django-...@googlegroups.com
#35354: Simplify ASGIRequest path handling.
-------------------------------------+-------------------------------------
Reporter: Carlton Gibson | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: assigned
Component: HTTP handling | Version: 5.0
Severity: Normal | Resolution:
Keywords: asgi | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson):

* cc: Andrew Godwin (added)

--
Ticket URL: <https://code.djangoproject.com/ticket/35354#comment:2>

Django

unread,
Apr 5, 2024, 4:40:02 AM4/5/24
to django-...@googlegroups.com
#35354: Simplify ASGIRequest path handling.
-------------------------------------+-------------------------------------
Reporter: Carlton Gibson | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: assigned
Component: HTTP handling | Version: 5.0
Severity: Normal | Resolution:
Keywords: asgi | Triage Stage:
| Unreviewed
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Description changed by Carlton Gibson:

Old description:

> Following the ASGI HTTP Connection Scope docs[0], the provided `path` is
> already the correct value that Django requires.
>
> In combination with `root_path`, from which `script_name` is derived, the
> `path_info` variable can is set.
> It's then redundant to re-calculate `path` from `script_name` and
> `path_info`.
>
> See also, a clarifying discussion on the ASGIref repo[1].
>
> [0]: https://asgi.readthedocs.io/en/latest/specs/www.html#http-
> connection-scope
> [1]: https://github.com/django/asgiref/issues/424

New description:

Following the ASGI HTTP Connection Scope docs[0], the provided `path` is
already the correct value that Django requires.

In combination with `root_path`, from which `script_name` is derived, the
`path_info` variable is set.
It's then redundant to re-calculate `path` from `script_name` and
`path_info`.

See also, a clarifying discussion on the ASGIref repo[1].

[0]: https://asgi.readthedocs.io/en/latest/specs/www.html#http-connection-
scope
[1]: https://github.com/django/asgiref/issues/424

--
--
Ticket URL: <https://code.djangoproject.com/ticket/35354#comment:3>

Django

unread,
Apr 5, 2024, 5:24:16 AM4/5/24
to django-...@googlegroups.com
#35354: Simplify ASGIRequest path handling.
-------------------------------------+-------------------------------------
Reporter: Carlton Gibson | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: assigned
Component: HTTP handling | Version: 5.0
Severity: Normal | Resolution:
Keywords: asgi | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by David Smith):

* stage: Unreviewed => Accepted

--
Ticket URL: <https://code.djangoproject.com/ticket/35354#comment:4>

Django

unread,
Apr 5, 2024, 3:01:42 PM4/5/24
to django-...@googlegroups.com
#35354: Simplify ASGIRequest path handling.
-------------------------------------+-------------------------------------
Reporter: Carlton Gibson | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: assigned
Component: HTTP handling | Version: 5.0
Severity: Normal | Resolution:
Keywords: asgi | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Natalia Bidart):

* stage: Accepted => Ready for checkin

--
Ticket URL: <https://code.djangoproject.com/ticket/35354#comment:5>

Django

unread,
Apr 5, 2024, 3:30:52 PM4/5/24
to django-...@googlegroups.com
#35354: Simplify ASGIRequest path handling.
-------------------------------------+-------------------------------------
Reporter: Carlton Gibson | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: closed
Component: HTTP handling | Version: 5.0
Severity: Normal | Resolution: fixed
Keywords: asgi | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Carlton Gibson <carlton.gibson@…>):

* resolution: => fixed
* status: assigned => closed

Comment:

In [changeset:"bcd255cd5ca0a1e686d276cca71f45ec400d84a2" bcd255cd]:
{{{#!CommitTicketReference repository=""
revision="bcd255cd5ca0a1e686d276cca71f45ec400d84a2"
Fixed #35354 -- Simplified ASGIRequest path handling.

Following the ASGI HTTP Connection Scope docs[0], the provided `path`
is already the correct value that Django requires.

In combination with `root_path`, from which `script_name` is derived,
the `path_info` variable is set. It's then redundant to
re-calculate `path` from `script_name` and `path_info`.

See also, a clarifying discussion on the ASGIref repo[1].

[0]: https://asgi.readthedocs.io/en/latest/specs/www.html#http-connection-
scope
[1]: https://github.com/django/asgiref/issues/424
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35354#comment:6>

Django

unread,
Apr 5, 2024, 3:30:52 PM4/5/24
to django-...@googlegroups.com
#35354: Simplify ASGIRequest path handling.
-------------------------------------+-------------------------------------
Reporter: Carlton Gibson | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: closed
Component: HTTP handling | Version: 5.0
Severity: Normal | Resolution: fixed
Keywords: asgi | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Carlton Gibson <carlton.gibson@…>):

In [changeset:"ca5cd3e3e8e53f15e68ccd727ec8fe719cc48099" ca5cd3e3]:
{{{#!CommitTicketReference repository=""
revision="ca5cd3e3e8e53f15e68ccd727ec8fe719cc48099"
Refs #35354 -- Clarified FORCE_SCRIPT_NAME docs.
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35354#comment:7>

Django

unread,
Apr 5, 2024, 3:31:39 PM4/5/24
to django-...@googlegroups.com
#35354: Simplify ASGIRequest path handling.
-------------------------------------+-------------------------------------
Reporter: Carlton Gibson | Owner: Carlton
Type: | Gibson
Cleanup/optimization | Status: closed
Component: HTTP handling | Version: 5.0
Severity: Normal | Resolution: fixed
Keywords: asgi | Triage Stage: Ready for
| checkin
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Comment (by Natalia <124304+nessita@…>):

In [changeset:"58061fd2b4c4b66c0fd3db8026c8b5e369ed9ec3" 58061fd2]:
{{{#!CommitTicketReference repository=""
revision="58061fd2b4c4b66c0fd3db8026c8b5e369ed9ec3"
[5.0.x] Refs #35354 -- Clarified FORCE_SCRIPT_NAME docs.

Backport of ca5cd3e3e8e53f15e68ccd727ec8fe719cc48099 from main
}}}
--
Ticket URL: <https://code.djangoproject.com/ticket/35354#comment:8>
Reply all
Reply to author
Forward
0 new messages