fixed issue 1046, thanks Houdini
This commit is contained in:
@@ -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
@@ -153,7 +153,10 @@ def copystream_progress(request, chunk_size= 10**5):
|
|||||||
if not env.content_length:
|
if not env.content_length:
|
||||||
return cStringIO.StringIO()
|
return cStringIO.StringIO()
|
||||||
source = env.wsgi_input
|
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()
|
dest = tempfile.TemporaryFile()
|
||||||
if not 'X-Progress-ID' in request.vars:
|
if not 'X-Progress-ID' in request.vars:
|
||||||
copystream(source, dest, size, chunk_size)
|
copystream(source, dest, size, chunk_size)
|
||||||
@@ -424,13 +427,16 @@ def wsgibase(environ, responder):
|
|||||||
local_hosts = [http_host,'::1','127.0.0.1',
|
local_hosts = [http_host,'::1','127.0.0.1',
|
||||||
'::ffff:127.0.0.1']
|
'::ffff:127.0.0.1']
|
||||||
if not global_settings.web2py_runtime_gae:
|
if not global_settings.web2py_runtime_gae:
|
||||||
local_hosts.append(socket.gethostname())
|
try:
|
||||||
|
local_hosts.append(socket.gethostname())
|
||||||
|
except TypeError:
|
||||||
|
pass
|
||||||
try:
|
try:
|
||||||
local_hosts.append(
|
local_hosts.append(
|
||||||
socket.gethostbyname(http_host))
|
socket.gethostbyname(http_host))
|
||||||
except socket.gaierror:
|
except (socket.gaierror,TypeError):
|
||||||
pass
|
pass
|
||||||
client = get_client(env)
|
client = get_client(env)
|
||||||
x_req_with = str(env.http_x_requested_with).lower()
|
x_req_with = str(env.http_x_requested_with).lower()
|
||||||
|
|
||||||
request.update(
|
request.update(
|
||||||
|
|||||||
+1
-1
@@ -1468,7 +1468,7 @@ class Worker(Thread):
|
|||||||
except UnicodeDecodeError:
|
except UnicodeDecodeError:
|
||||||
self.err_log.warning('Client sent invalid header: ' + repr(l))
|
self.err_log.warning('Client sent invalid header: ' + repr(l))
|
||||||
|
|
||||||
if l == '\r\n':
|
if l.strip() == '':
|
||||||
break
|
break
|
||||||
|
|
||||||
if l[0] in ' \t' and lname:
|
if l[0] in ' \t' and lname:
|
||||||
|
|||||||
Reference in New Issue
Block a user