WSGI Protocol Linter¶
This module provides a middleware that performs sanity checks on the behavior of the WSGI server and application. It checks that the PEP 3333 WSGI spec is properly implemented. It also warns on some common HTTP errors such as non-empty responses for 304 status codes.
Warns about common errors in the WSGI and HTTP behavior of the server and wrapped application. Some of the issues it checks are:
invalid status codes
non-bytes sent to the WSGI server
strings returned from the WSGI application
non-empty conditional responses
relative URLs in the Location header
unsafe calls to wsgi.input
Error information is emitted using the
app – The WSGI application to wrap.
from werkzeug.middleware.lint import LintMiddleware app = LintMiddleware(app)