#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:  Unreviewed
    Has patch:  1              |      Needs documentation:  0
  Needs tests:  0              |  Patch needs improvement:  0
Easy pickings:  0              |                    UI/UX:  0
-------------------------------+--------------------------------------
Description changed by Jonas Haag:

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 }}">
 }}}

 Patch: https://github.com/django/django/pull/9253

--

-- 
Ticket URL: <https://code.djangoproject.com/ticket/28720#comment:1>
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.e9191a35c7705d74aa345238bd53bdd9%40djangoproject.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to