diff options
-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 |