mirror of
https://github.com/frappe/gunicorn.git
synced 2026-01-14 11:09:11 +08:00
fix issue #80
This commit is contained in:
parent
42d97c3815
commit
e64c47475b
@ -62,6 +62,8 @@ def create(req, sock, client, server, cfg):
|
|||||||
if forward.find(",") >= 0:
|
if forward.find(",") >= 0:
|
||||||
forward = forward.rsplit(",", 1)[1].strip()
|
forward = forward.rsplit(",", 1)[1].strip()
|
||||||
remote = forward.split(":")
|
remote = forward.split(":")
|
||||||
|
if len(remote) < 2:
|
||||||
|
remote.append('80')
|
||||||
if len(remote) == 1:
|
if len(remote) == 1:
|
||||||
remote.append('')
|
remote.append('')
|
||||||
else:
|
else:
|
||||||
@ -109,7 +111,7 @@ def create(req, sock, client, server, cfg):
|
|||||||
key = 'HTTP_' + key.replace('-', '_')
|
key = 'HTTP_' + key.replace('-', '_')
|
||||||
if key not in ('HTTP_CONTENT_TYPE', 'HTTP_CONTENT_LENGTH'):
|
if key not in ('HTTP_CONTENT_TYPE', 'HTTP_CONTENT_LENGTH'):
|
||||||
environ[key] = value
|
environ[key] = value
|
||||||
|
|
||||||
return resp, environ
|
return resp, environ
|
||||||
|
|
||||||
class Response(object):
|
class Response(object):
|
||||||
|
|||||||
@ -80,6 +80,8 @@ class AsyncWorker(base.Worker):
|
|||||||
if req.should_close():
|
if req.should_close():
|
||||||
raise StopIteration()
|
raise StopIteration()
|
||||||
self.cfg.post_request(self, req)
|
self.cfg.post_request(self, req)
|
||||||
|
except StopIteration:
|
||||||
|
raise
|
||||||
except Exception, e:
|
except Exception, e:
|
||||||
#Only send back traceback in HTTP in debug mode.
|
#Only send back traceback in HTTP in debug mode.
|
||||||
if not self.debug:
|
if not self.debug:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user