mirror of
https://github.com/reddit-archive/reddit.git
synced 2026-04-05 03:00:15 -04:00
Make request.fullurl reflect the c.secure url_scheme change.
This commit is contained in:
committed by
Neil Williams
parent
01582db9e6
commit
552e9828ab
@@ -275,11 +275,6 @@ class FullPathMiddleware(object):
|
||||
qs = environ.get('QUERY_STRING')
|
||||
if qs:
|
||||
environ['FULLPATH'] += '?' + qs
|
||||
environ['FULLURL'] = "%s://%s%s" % (
|
||||
environ['wsgi.url_scheme'],
|
||||
environ['HTTP_HOST'],
|
||||
environ['FULLPATH']
|
||||
)
|
||||
return self.app(environ, start_response)
|
||||
|
||||
class StaticTestMiddleware(object):
|
||||
|
||||
@@ -750,6 +750,8 @@ class MinimalController(BaseController):
|
||||
# upstream things like stunnel/haproxy.
|
||||
if c.secure:
|
||||
request.environ["wsgi.url_scheme"] = "https"
|
||||
# update request.fullurl since wsgi.url_scheme changed.
|
||||
request.fullurl = request.host_url + request.fullpath
|
||||
|
||||
c.request_origin = request.host_url
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ class BaseController(WSGIController):
|
||||
request.referer = environ.get('HTTP_REFERER')
|
||||
request.user_agent = environ.get('HTTP_USER_AGENT')
|
||||
request.fullpath = environ.get('FULLPATH', request.path)
|
||||
request.fullurl = environ.get('FULLURL', request.url)
|
||||
request.fullurl = request.host_url + request.fullpath
|
||||
request.port = environ.get('request_port')
|
||||
|
||||
if_modified_since = environ.get('HTTP_IF_MODIFIED_SINCE')
|
||||
|
||||
Reference in New Issue
Block a user