summaryrefslogtreecommitdiff
path: root/paste/evalexception
diff options
context:
space:
mode:
authorpjenvey <devnull@localhost>2006-07-24 01:47:00 +0000
committerpjenvey <devnull@localhost>2006-07-24 01:47:00 +0000
commit759c5013fe8c1c8bebc31a6858bac54f9472e03a (patch)
tree97dac026a1f573aa947f7ace94d21756a1cf74c2 /paste/evalexception
parent53509bbe29703aa6d5057db7129e0378ad51522c (diff)
downloadpaste-759c5013fe8c1c8bebc31a6858bac54f9472e03a.tar.gz
o request.parse_formvars changes:
- now returns a multidict instead of dict (like parse_dict_querystring) - removed all_as_list keyword arg: use multidict.mixed() instead to produce an all_as_list dict - preventing FieldStorage from parsing out QUERY_STRING during GET/HEAD requests - the fake_out_cgi check wasn't careful enough about multipart/form-data content-types. Was also missing a StringIO import (r5471 broke file uploads) o evalexception's wsgiapp decorator assumed parse_formvars would return GET vars during a GET (buggy behavior), now it explicitly asks for them
Diffstat (limited to 'paste/evalexception')
-rw-r--r--paste/evalexception/middleware.py24
1 files changed, 12 insertions, 12 deletions
diff --git a/paste/evalexception/middleware.py b/paste/evalexception/middleware.py
index 41c5751..792993b 100644
--- a/paste/evalexception/middleware.py
+++ b/paste/evalexception/middleware.py
@@ -105,13 +105,14 @@ def wsgiapp():
environ, start_response = args
args = []
def application(environ, start_response):
- form = wsgilib.parse_formvars(environ)
+ form = wsgilib.parse_formvars(environ,
+ include_get_vars=True)
headers = wsgilib.ResponseHeaderDict(
{'content-type': 'text/html',
'status': '200 OK'})
form['environ'] = environ
form['headers'] = headers
- res = func(*args, **form)
+ res = func(*args, **form.mixed())
status = headers.pop('status')
start_response(status, headers.headeritems())
return [res]
@@ -523,16 +524,15 @@ def make_repost_button(environ):
# I can't get it back :(
return None
fields = []
- for name, value_list in wsgilib.parse_formvars(
- environ, all_as_list=True, include_get_vars=False).items():
- for value in value_list:
- if hasattr(value, 'filename'):
- # @@: Arg, we'll just submit the body, and leave out
- # the filename :(
- value = value.value
- fields.append(
- '<input type="hidden" name="%s" value="%s">'
- % (html_quote(name), html_quote(value)))
+ for name, value in wsgilib.parse_formvars(
+ environ, include_get_vars=False).items():
+ if hasattr(value, 'filename'):
+ # @@: Arg, we'll just submit the body, and leave out
+ # the filename :(
+ value = value.value
+ fields.append(
+ '<input type="hidden" name="%s" value="%s">'
+ % (html_quote(name), html_quote(value)))
return '''
<form action="%s" method="POST">
%s