Opened 7 years ago
Closed 7 years ago
#28720 closed New feature (fixed)
Add HttpRequest.get_full_path_info()
Reported by: | Jonas Haag | Owned by: | nobody |
---|---|---|---|
Component: | HTTP handling | Version: | dev |
Severity: | Normal | Keywords: | |
Cc: | Triage Stage: | Accepted | |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description (last modified by )
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 }}">
Change History (3)
comment:1 by , 7 years ago
Description: | modified (diff) |
---|
comment:2 by , 7 years ago
Description: | modified (diff) |
---|---|
Summary: | Add HttpRequest.get_full_path_info → Add HttpRequest.get_full_path_info() |
Triage Stage: | Unreviewed → Accepted |
comment:3 by , 7 years ago
Resolution: | → fixed |
---|---|
Status: | new → closed |
Note:
See TracTickets
for help on using tickets.
In a2851f2: