summaryrefslogtreecommitdiff
path: root/wsgitools/middlewares.py
AgeCommit message (Collapse)Author
2019-01-17ContentLengthMiddleware: don't duplicate the headerHelmut Grohne
When an iterable is returned and a Content-Length header is already present, don't add a second one.
2018-12-27fix ContentLengthMiddleware(..., maxstore=()) on Py3kHelmut Grohne
On Python 2.x, any integer sorts below the empty tuple. That was exploited in the maxstore parameter, but fails on Python 3 with a TypeError. Also add a regression test. Reported-by: Dominik Brodowski <mail@dominikbrodowski.net>
2015-04-18Merge branch py3kHelmut Grohne
2014-01-06switch to new-style classes entirelyHelmut Grohne
There is no reason to use old-style classes beyond laziness.
2012-06-29fix more bytes related issues not covered by test.pyHelmut Grohne
* applications returned errors as str instead of bytes * filters documentation updated with bytes * various filters expecting str where bytes are passed * escape_string also needs to use bytes.isalnum instead of str.isalnum * middlewares injecting str where bytes are expected
2012-06-29fix hashlib, base64 and other bytes issuesHelmut Grohne
* hashlib.md5 wants bytes now. * string.decode("base64") is now base64.b64decode and works on bytes * binascii.unhexlify is now base64.b16decode and also works on bytes * str.isalnum accepts umlauts, use bytes.isalnum instead
2012-06-28first part of bytes conversionHelmut Grohne
Convert the request body data from str to bytes. This replaces all StringIOs with BytesIOs (removing backwards one more backwards compatibility). Also all character sequences involved in request bodies get a b"" prefix. The StaticContent application takes bytes instead of str (no difference for py2x). The GzipWSGIFilter needs a fixed as a truncate of a BytesIO does not rewind the stream position.
2012-06-28remove workarounds for missing next() and hashlibHelmut Grohne
2012-03-15raise exc_info stuff properlyHelmut Grohne
2012-03-15middlewares: support multiple start_response callsHelmut Grohne
Previously middlewares mostly gave up and acted as pass through when a second start_response call occurred. Now they try to handle this situation.
2012-03-15fix failing NoWriteCallableMiddleware testHelmut Grohne
This was basically a rewrite of the NoWriteCallableMiddleware, because the wrong assumption of start_response not being called twice was used in too many places.
2011-11-30shrink AuthenticationMiddleware.authenticate interfaceHelmut Grohne
The method no longer receives a start_response and is no longer responsible for calling self.app. Instead it returns a dictionary with the result of the authentication.
2011-11-27added new base class AuthenticationMiddlewareHelmut Grohne
The BasicAuthMiddleware and AuthDigestMiddleware now derive from AuthenticationMiddleware which provides common functionality.
2011-07-22BasicAuthMiddleware docstring: mention REMOTE_USERHelmut Grohne
2011-06-01improved doc string for middlewares.ContentLengthMiddlewareHelmut Grohne
2011-01-12DictAuthChecker.__call__ should take an environwsgitools-0.2.2Helmut Grohne
as this is tried by BasicAuthMiddleware first.
2011-01-12bug fix for StaticContent and CachingMiddlewareHelmut Grohne
PEP333 says that the headers list passed to start_response may be modified by servers or middlewares. In fact this happens in DigestAuthMiddleware. The StaticContent and CachingMiddleware classes did not take this into account and returned the same headers list multiple times which is wrong and can lead to denial of service.
2010-09-04added note about ContentLengthMiddleware's wsgi conformanceHelmut Grohne
2010-09-04CachingMiddleware: automatic cache pruning implementedHelmut Grohne
2010-09-04middlewares.CachingMiddleware: include request method in keyHelmut Grohne
2010-08-31bugfix: io module from py2.6 provides incompatible StringIOHelmut Grohne
2009-03-29quite some changes for py3Helmut Grohne
These changes introduce some compatibility code. They don't make wsgitools usable with Python 3.0, but they also don't break compatibility with Python 2.5.
2009-02-27except binascii.Error instead of Exception in middlewaresHelmut Grohne
2008-10-14added epydoc markup to doc stringsHelmut Grohne
2008-09-22improve commentsHelmut Grohne
2008-09-10change BasicAuthMiddleware againHelmut Grohne
2008-09-09made error page for BasicAuthMiddleware configurableHelmut Grohne
2008-09-09update BasicAuthMiddleware docs to reflect api changeHelmut Grohne
2008-07-12fix some comments and epydocify themHelmut Grohne
2008-07-12refactor middlewares.NoWriteCallableMiddlewareHelmut Grohne
2008-07-08add environ param to check_function in middlewares.BasicAuthMiddlewareHelmut Grohne
The check_function passed to the BasicAuthMiddleware constructur will now receive a third parameter environ to check against additional things. If the function does not take a third parameter the function will be called in the old manner thus maintaining backwards compatibility.
2008-03-29fix middleware start_reponse to accept only two parametersHelmut Grohne
2008-03-28fixed non-fatal bugsHelmut Grohne
2008-03-27epydoc updateHelmut Grohne
2008-02-28refactored docstrings for epydocHelmut Grohne
2007-04-21added some assertionsHelmut Grohne
2007-04-21fixed NoWriteCallableMiddleware with exc_info !Helmut Grohne
2007-04-20added better support for HEADHelmut Grohne
2007-04-15added docstringsHelmut Grohne
2007-04-15don't except: when knowing whats thrownHelmut Grohne
2007-04-15TracebackMiddleware catches more exceptionsHelmut Grohne
2007-04-15fixed indenting with tabsHelmut Grohne
2007-04-14added TracebackMiddlewareHelmut Grohne
2007-04-14initial treeHelmut Grohne