diff options
| author | pjenvey <devnull@localhost> | 2006-10-20 21:44:50 +0000 |
|---|---|---|
| committer | pjenvey <devnull@localhost> | 2006-10-20 21:44:50 +0000 |
| commit | 483f834e298aa5ad2dd098d24e3646667b0fd6f7 (patch) | |
| tree | e0ca8d3f275327278131869bd18e578a437d96dd | |
| parent | ddc05eed53f1d3ec8cadf267a0b7a88266aa295b (diff) | |
| download | paste-483f834e298aa5ad2dd098d24e3646667b0fd6f7.tar.gz | |
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
| -rw-r--r-- | docs/news.txt | 3 | ||||
| -rw-r--r-- | paste/request.py | 8 |
2 files changed, 7 insertions, 4 deletions
diff --git a/docs/news.txt b/docs/news.txt index b072e2e..09be876 100644 --- a/docs/news.txt +++ b/docs/news.txt @@ -6,6 +6,9 @@ News svn trunk --------- +* Fixed ``parsed_formvars`` potentially locking up on wsgi.input + after modification of ``QUERY_STRING``. + * Fixed problem where ``paste.exceptions.errormiddleware`` didn't expose the ``.close()`` method of the app_iter that it wraps (to catch exceptions). This is a problem if the server about the 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, |
