fixed issue 1046, thanks Houdini

This commit is contained in:
mdipierro
2012-09-29 10:17:06 -05:00
parent 492a0c51d1
commit cd955d3603
3 changed files with 13 additions and 7 deletions
+1 -1
View File
@@ -1 +1 @@
Version 2.0.9 (2012-09-29 09:55:50) dev
Version 2.0.9 (2012-09-29 10:16:59) dev
+11 -5
View File
@@ -153,7 +153,10 @@ def copystream_progress(request, chunk_size= 10**5):
if not env.content_length:
return cStringIO.StringIO()
source = env.wsgi_input
size = int(env.content_length)
try:
size = int(env.content_length)
except ValueError:
raise HTTP(400,"Invalid Content-Length header")
dest = tempfile.TemporaryFile()
if not 'X-Progress-ID' in request.vars:
copystream(source, dest, size, chunk_size)
@@ -424,13 +427,16 @@ def wsgibase(environ, responder):
local_hosts = [http_host,'::1','127.0.0.1',
'::ffff:127.0.0.1']
if not global_settings.web2py_runtime_gae:
local_hosts.append(socket.gethostname())
try:
local_hosts.append(socket.gethostname())
except TypeError:
pass
try:
local_hosts.append(
socket.gethostbyname(http_host))
except socket.gaierror:
socket.gethostbyname(http_host))
except (socket.gaierror,TypeError):
pass
client = get_client(env)
client = get_client(env)
x_req_with = str(env.http_x_requested_with).lower()
request.update(
+1 -1
View File
@@ -1468,7 +1468,7 @@ class Worker(Thread):
except UnicodeDecodeError:
self.err_log.warning('Client sent invalid header: ' + repr(l))
if l == '\r\n':
if l.strip() == '':
break
if l[0] in ' \t' and lname: