#28720: Add HttpRequest.get_full_path_info()
-------------------------------+------------------------------------
Reporter: Jonas Haag | Owner: nobody
Type: New feature | Status: new
Component: HTTP handling | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-------------------------------+------------------------------------
Changes (by Tim Graham):
* stage: Unreviewed => Accepted
Old description:
> `HttpRequest.get_full_path` returns the `HttpRequest.path` based full
> path, including query string. Example: `/posts/12345/?foo=bar`.
>
> We should add a counterpart for `HttpRequest.path_info` that includes the
> `SCRIPT_NAME`, if set. Example: `/scriptname/posts/12345/?foo=bar`
>
> Example use case: Adding hreflang meta tags to your `<head>` section.
> This must include the `SCRIPT_NAME` prefix as well, otherwise invalid
> URLs are given.
>
> {{{
> <link rel=alternative hreflang=en href="https://yourdomain.com{{
> request.get_full_path_info }}">
> }}}
>
> Patch: https://github.com/django/django/pull/9253
New description:
`HttpRequest.get_full_path()` returns the `HttpRequest.path` based full
path, including query string. Example: `/posts/12345/?foo=bar`.
We should add a counterpart for `HttpRequest.path_info()` that includes
the `SCRIPT_NAME`, if set. Example: `/scriptname/posts/12345/?foo=bar`
Example use case: Adding hreflang meta tags to your `<head>` section. This
must include the `SCRIPT_NAME` prefix as well, otherwise invalid URLs are
given.
{{{
<link rel=alternative hreflang=en href="https://yourdomain.com{{
request.get_full_path_info }}">
}}}
[https://github.com/django/django/pull/9253 PR]
--
--
Ticket URL: <https://code.djangoproject.com/ticket/28720#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/django-updates/067.4c6857f693e389d520513f68a59e30a7%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.