diff options
author | Helmut Grohne <helmut@subdivi.de> | 2011-06-01 15:18:07 +0200 |
---|---|---|
committer | Helmut Grohne <helmut@subdivi.de> | 2011-06-01 15:18:07 +0200 |
commit | 8603cef047ae1c892f862535ec36da2eb429c2fd (patch) | |
tree | f6122d3ed093c8940fbbf475fcedf7f5a0ac1194 /wsgitools | |
parent | 47f047b0868480767ee05f66e587819d9b472937 (diff) | |
download | wsgitools-8603cef047ae1c892f862535ec36da2eb429c2fd.tar.gz |
improved doc string for middlewares.ContentLengthMiddleware
Diffstat (limited to 'wsgitools')
-rw-r--r-- | wsgitools/middlewares.py | 11 |
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 |