用于web应用程序安全的wsgi中间件
guard的Python项目详细描述
guard是通用wsgi中间件和用于改进的实用程序的集合。 web应用程序的安全性
内容安全策略
guard.ContentSecurityPolicy提供了一个可以使用的wsgi中间件 为web应用程序提供内容安全策略
使用量
importguard,wsgi_app# Default Policyapp=guard.ContentSecurityPolicy(wsgi_app.application)# Custom Directivesapp=guard.ContentSecurityPolicy(wsgi_app.application,{"img-src":["*"]})# Report Onlyapp=guard.ContentSecurityPolicy(wsgi_app.application,report_only=True)