# Lint Validation Middleware
0.5 新版功能.
This module provides a middleware that performs sanity checks of the WSGIapplication. It checks that [**PEP 333**](http://www.python.org/dev/peps/pep-0333) is properly implemented and warnson some common HTTP errors such as non-empty responses for 304 statuscodes.
This module provides a middleware, the [LintMiddleware](# "werkzeug.contrib.lint.LintMiddleware"). Wrap yourapplication with it and it will warn about common problems with WSGI andHTTP while your application is running.
It's strongly recommended to use it during development.
*class *werkzeug.contrib.lint.LintMiddleware(*app*)
This middleware wraps an application and warns on common errors.Among other thing it currently checks for the following problems:
- 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 iterators
Detected errors are emitted using the standard Python [warnings](http://docs.python.org/dev/library/warnings.html#module-warnings "(在 Python v3.5)") system and usually end up on stderr.
~~~
from werkzeug.contrib.lint import LintMiddleware
app = LintMiddleware(app)
~~~
| 参数: | **app** – the application to wrap |
|-----|-----|
- 开始
- Werkzeug 文档概览
- 安装
- 过渡到 Werkzeug 1.0
- Werkzeug 教程
- API 标准
- 快速开始
- Python 3 Notes
- 服务和测试
- Debugging Applications
- 在服务器运行 WSGI 应用
- 单元测试
- 参考
- Request / Response Objects
- URL Routing
- WSGI Helpers
- HTTP Utilities
- Data Structures
- Utilities
- Context Locals
- Middlewares
- HTTP Exceptions
- 部署
- CGI
- mod_wsgi (Apache)
- FastCGI
- HTTP Proxying
- 贡献模块
- Atom Syndication
- Sessions
- Secure Cookie
- Cache
- Extra Wrappers
- Iter IO
- Fixers
- WSGI Application Profiler
- Lint Validation Middleware
- 额外说明
- Werkzeug Changelog
- Important Terms
- Unicode
- Dealing with Request Data