From 483f834e298aa5ad2dd098d24e3646667b0fd6f7 Mon Sep 17 00:00:00 2001 From: pjenvey Date: Fri, 20 Oct 2006 21:44:50 +0000 Subject: changes to QUERY_STRING shouldn't trigger reparsing of formvars: no longer caching QUERY_STRING vars together with parsed_formvars (parse_querystring caches them anyway) nor using QUERY_STRING information as cache keys --- paste/request.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'paste/request.py') diff --git a/paste/request.py b/paste/request.py index 5c5898d..dc3f20a 100644 --- a/paste/request.py +++ b/paste/request.py @@ -136,12 +136,12 @@ def parse_formvars(environ, include_get_vars=True): If the request was not a normal form request (e.g., a POST with an XML body) then ``environ['wsgi.input']`` won't be read. """ - source = (environ.get('QUERY_STRING', ''), - environ['wsgi.input'], - include_get_vars) + source = environ['wsgi.input'] if 'paste.parsed_formvars' in environ: parsed, check_source = environ['paste.parsed_formvars'] if check_source == source: + if include_get_vars: + parsed.update(parse_querystring(environ)) return parsed # @@: Shouldn't bother FieldStorage parsing during GET/HEAD and # fake_out_cgi requests @@ -177,9 +177,9 @@ def parse_formvars(environ, include_get_vars=True): if not value.filename: value = value.value formvars.add(name, value) + environ['paste.parsed_formvars'] = (formvars, source) if include_get_vars: formvars.update(parse_querystring(environ)) - environ['paste.parsed_formvars'] = (formvars, source) return formvars def construct_url(environ, with_query_string=True, with_path_info=True, -- cgit v1.2.1