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