diff options
author | ianb <devnull@localhost> | 2006-11-26 17:06:00 +0000 |
---|---|---|
committer | ianb <devnull@localhost> | 2006-11-26 17:06:00 +0000 |
commit | 91541f9194baf695ba94a9117537186f074951e3 (patch) | |
tree | f404c22f03c17b55d0cf5b198054a65054165b8a /paste/request.py | |
parent | 25e36b34d029a1f936f47a972c5853a7b671e7c2 (diff) | |
download | paste-91541f9194baf695ba94a9117537186f074951e3.tar.gz |
Handle request CONTENT_TYPE with parameters (e.g., charset=X). prototype.js sets this on requests
Diffstat (limited to 'paste/request.py')
-rw-r--r-- | paste/request.py | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/paste/request.py b/paste/request.py index 405011b..63941cc 100644 --- a/paste/request.py +++ b/paste/request.py @@ -148,8 +148,10 @@ def parse_formvars(environ, include_get_vars=True): # @@: Shouldn't bother FieldStorage parsing during GET/HEAD and # fake_out_cgi requests type = environ.get('CONTENT_TYPE', '').lower() - fake_out_cgi = type not in ('', 'application/x-www-form-urlencoded') and \ - not type.startswith('multipart/form-data') + if ';' in type: + type = type.split(';', 1) + fake_out_cgi = (type not in ('', 'application/x-www-form-urlencoded') + and not type.startswith('multipart/form-data')) # Prevent FieldStorage from parsing QUERY_STRING during GET/HEAD # requests old_query_string = environ.get('QUERY_STRING','') |