summaryrefslogtreecommitdiff
path: root/paste/wsgilib.py
diff options
context:
space:
mode:
authorcce <devnull@localhost>2005-12-23 21:36:37 +0000
committercce <devnull@localhost>2005-12-23 21:36:37 +0000
commit370ba732f785cc211e850664ecfea6a62fea30b4 (patch)
treebbc6b3281820448e64ada2ae5c45e39a0170e15a /paste/wsgilib.py
parentdb53428a989dca0526d5f6a4bad5c91424424ea1 (diff)
downloadpaste-370ba732f785cc211e850664ecfea6a62fea30b4.tar.gz
- got rid of unnecessary trailing spaces in httpexceptions
- made error messages us \r\n rather than just \n in httpexceptions to comply with various browsers - added tests to check FileApp - added support for handling 100 Continue in httpserver - fixingup dumpenviron in wsgilib to dump message body - misc changes to fileapp (mostly documentation)
Diffstat (limited to 'paste/wsgilib.py')
-rw-r--r--paste/wsgilib.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/paste/wsgilib.py b/paste/wsgilib.py
index 8b0cf67..4c02a02 100644
--- a/paste/wsgilib.py
+++ b/paste/wsgilib.py
@@ -34,7 +34,7 @@ class add_close:
An an iterable that iterates over app_iter, then calls
close_func.
"""
-
+
def __init__(self, app_iterable, close_func):
self.app_iterable = app_iterable
self.app_iter = iter(app_iterable)
@@ -259,7 +259,7 @@ def interactive(*args, **kw):
interactive.proxy = 'raw_interactive'
def dump_environ(environ,start_response):
- """
+ """
Application which simply dumps the current environment
variables out as a plain text response.
"""
@@ -269,6 +269,11 @@ def dump_environ(environ,start_response):
for k in keys:
v = str(environ[k]).replace("\n","\n ")
output.append("%s: %s\n" % (k,v))
+ output.append("\n")
+ content_length = environ.get("CONTENT_LENGTH",'')
+ if content_length:
+ output.append(environ['wsgi.input'].read(int(content_length)))
+ output.append("\n")
output = "".join(output)
headers = [('Content-Type', 'text/plain'),
('Content-Length', len(output))]