summaryrefslogtreecommitdiff
path: root/paste/request.py
diff options
context:
space:
mode:
authorianb <devnull@localhost>2006-11-26 20:57:24 +0000
committerianb <devnull@localhost>2006-11-26 20:57:24 +0000
commitfb4faa785e6cdee2e94a3c099fbb7d43e77bd743 (patch)
tree2a99d04c608d0fd746dd7758fb42dda0e3d99899 /paste/request.py
parente3585e39324bfb39d1a3ca80e5cb9c743d36b1ab (diff)
downloadpaste-fb4faa785e6cdee2e94a3c099fbb7d43e77bd743.tar.gz
Handle case when CONTENT_LENGTH is empty string (which cgi.FieldStorage treats the same as missing)
Diffstat (limited to 'paste/request.py')
-rw-r--r--paste/request.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/paste/request.py b/paste/request.py
index b710cea..30b209c 100644
--- a/paste/request.py
+++ b/paste/request.py
@@ -154,7 +154,8 @@ def parse_formvars(environ, include_get_vars=True):
and not type.startswith('multipart/form-data'))
# FieldStorage assumes a default CONTENT_LENGTH of -1, but a
# default of 0 is better:
- environ.setdefault('CONTENT_LENGTH', '0')
+ if not environ.get('CONTENT_LENGTH'):
+ environ['CONTENT_LENGTH'] = '0'
# Prevent FieldStorage from parsing QUERY_STRING during GET/HEAD
# requests
old_query_string = environ.get('QUERY_STRING','')