summaryrefslogtreecommitdiff
path: root/wsgitools
diff options
context:
space:
mode:
authorHelmut Grohne <helmut@subdivi.de>2011-06-01 15:18:07 +0200
committerHelmut Grohne <helmut@subdivi.de>2011-06-01 15:18:07 +0200
commit8603cef047ae1c892f862535ec36da2eb429c2fd (patch)
treef6122d3ed093c8940fbbf475fcedf7f5a0ac1194 /wsgitools
parent47f047b0868480767ee05f66e587819d9b472937 (diff)
downloadwsgitools-8603cef047ae1c892f862535ec36da2eb429c2fd.tar.gz
improved doc string for middlewares.ContentLengthMiddleware
Diffstat (limited to 'wsgitools')
-rw-r--r--wsgitools/middlewares.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/wsgitools/middlewares.py b/wsgitools/middlewares.py
index 2b6b51b..709304f 100644
--- a/wsgitools/middlewares.py
+++ b/wsgitools/middlewares.py
@@ -118,11 +118,12 @@ class ContentLengthMiddleware:
@note: The application used must not use the C{write} callable returned by
C{start_response}."""
def __init__(self, app, maxstore=0):
- """Wraps wsgi application app. It can also store the first result bytes
- to possibly return a list of strings which will make guessing the size
- of iterators possible. At most maxstore bytes will be accumulated.
- Please note that a value larger than 0 will violate the wsgi standard.
- The magical value C{()} will make it always gather all data.
+ """Wraps wsgi application app. If the application returns a list, the
+ total length of strings is available and the content length header is
+ set unless there already is one. For an iterator data is accumulated up
+ to a total of maxstore bytes (where maxstore=() means infinity). If the
+ iterator is exhaused within maxstore bytes a content length header is
+ added unless already present.
@type maxstore: int or ()
@note: that setting maxstore to a value other than 0 will violate the
wsgi standard