Commit f4c35d56 authored by Denis Bilenko's avatar Denis Bilenko

wsgi: do not pass request to prepare_env (it's already available as self.request)

parent a2b850bf
...@@ -78,7 +78,8 @@ class WSGIHandler(object): ...@@ -78,7 +78,8 @@ class WSGIHandler(object):
if log is not None: if log is not None:
log.write(self.format_request(*args) + '\n') log.write(self.format_request(*args) + '\n')
def prepare_env(self, req): def prepare_env(self):
req = self.request
env = self.server.get_environ() env = self.server.get_environ()
if '?' in req.uri: if '?' in req.uri:
path, query = req.uri.split('?', 1) path, query = req.uri.split('?', 1)
...@@ -100,8 +101,7 @@ class WSGIHandler(object): ...@@ -100,8 +101,7 @@ class WSGIHandler(object):
return env return env
def handle(self): def handle(self):
req = self.request env = self.prepare_env()
env = self.prepare_env(req)
try: try:
try: try:
result = self.server.application(env, self.start_response) result = self.server.application(env, self.start_response)
...@@ -116,7 +116,7 @@ class WSGIHandler(object): ...@@ -116,7 +116,7 @@ class WSGIHandler(object):
traceback.print_exc() traceback.print_exc()
try: try:
sys.stderr.write('%s: Failed to handle request:\n request = %s\n application = %s\n\n' % sys.stderr.write('%s: Failed to handle request:\n request = %s\n application = %s\n\n' %
(self.server, req, self.server.application)) (self.server, self.request, self.server.application))
except Exception: except Exception:
pass pass
# do not call self.end so that core.http replies with 500 # do not call self.end so that core.http replies with 500
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment