56 script_name = self.
script_name or environ.get(
'HTTP_X_SCRIPT_NAME',
'')
58 environ[
'SCRIPT_NAME'] = script_name
59 path_info = environ[
'PATH_INFO']
60 if path_info.startswith(script_name):
61 environ[
'PATH_INFO'] = path_info[len(script_name) :]
63 scheme = self.
scheme or environ.get(
'HTTP_X_SCHEME',
'')
65 environ[
'wsgi.url_scheme'] = scheme
67 server = self.
server or environ.get(
'HTTP_X_FORWARDED_HOST',
'')
69 environ[
'HTTP_HOST'] = server
70 return self.
wsgi_app(environ, start_response)