summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoel Rivera <rivera@joel.mx>2015-10-24 16:56:25 -0500
committerJoel Rivera <rivera@joel.mx>2015-10-24 16:56:25 -0500
commit61db471d03e88911a52cb8eb5c991a901b1d9a12 (patch)
treec0d3379b0ae11bd8f4d06a7d75e7b13d30ee0140
parent76c3eb6806fed1be0d8ef7ccbaee92dd250e45ef (diff)
downloadcherrypy-61db471d03e88911a52cb8eb5c991a901b1d9a12.tar.gz
Fix the unix socket support in cherrypy. It was crashing when the ServerPort
was an empty string, which is the case when we are using the option `server.socket_file` for the unix socket support. Fixes issue #1011.
-rw-r--r--cherrypy/_cpwsgi.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/cherrypy/_cpwsgi.py b/cherrypy/_cpwsgi.py
index f6db68b0..a8068fb0 100644
--- a/cherrypy/_cpwsgi.py
+++ b/cherrypy/_cpwsgi.py
@@ -296,7 +296,8 @@ class AppResponse(object):
"""Create a Request object using environ."""
env = self.environ.get
- local = httputil.Host('', int(env('SERVER_PORT', 80)),
+ local = httputil.Host('',
+ int(env('SERVER_PORT', 80) or -1),
env('SERVER_NAME', ''))
remote = httputil.Host(env('REMOTE_ADDR', ''),
int(env('REMOTE_PORT', -1) or -1),