def forwarder environ start_response https environ get HTTP_X_SSL None

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
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
server = Server((opts.address, int(opts.port)), get_app(),
int(opts.threads), opts.server_name)