Opened 17 years ago
Last modified 12 years ago
#7603 closed
The Request object should have a "scheme" attribute — at Version 2
| Reported by: | nslater | Owned by: | nobody |
|---|---|---|---|
| Component: | HTTP handling | Version: | dev |
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Ready for checkin | |
| Has patch: | yes | Needs documentation: | no |
| Needs tests: | no | Patch needs improvement: | no |
| Easy pickings: | no | UI/UX: | no |
Description (last modified by )
As it stands, the scheme is located at request["wsgi.url_scheme"] which translates as {{ request.wsgi.url_scheme}} which is invalid for obvious reasons, leaving no way to access this value from the template.
The Request object should be modified to have a "scheme" attritbute.
I could then do this from a template:
<img src="{{ request.scheme }}://{{ site.domain }}/logo"/>
Change History (2)
comment:1 by , 17 years ago
comment:2 by , 17 years ago
| Description: | modified (diff) |
|---|
Note:
See TracTickets
for help on using tickets.
You could also use a "protocol relative URI" that starts with two slashes: {{ site.domain }}/logo
(For an example in the wild, ibm.com uses this technique.)