From 91541f9194baf695ba94a9117537186f074951e3 Mon Sep 17 00:00:00 2001 From: ianb Date: Sun, 26 Nov 2006 17:06:00 +0000 Subject: Handle request CONTENT_TYPE with parameters (e.g., charset=X). prototype.js sets this on requests --- paste/request.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'paste/request.py') 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','') -- cgit v1.2.1