def get_app def forwarder environ start_response https environ get HTT

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
def get_app():
def forwarder(environ, start_response):
https = environ.get('HTTP_X_SSL', None)
if https is not None:
environ['wsgi.url_scheme'] = 'https'
user = environ.get('HTTP_X_REMOTE_USER', None)
if user is not None:
environ['REMOTE_USER'] = user
app(environ, start_response)
if opts.config:
app = hgwebdir(opts.config)
else:
app = hgweb(args[0])
return forwarder