CSP content hashes (#1406)

* remove duplicate content-type header

* plumbing to compute CSP content hashes

* add logging of missing CSP hashes

* convert sub-class init protocol to static

* factor function

* lint
This commit is contained in:
Bruce Martin
2020-04-17 11:42:09 -07:00
committed by GitHub
parent d22300e3db
commit 55ef1448e8
9 changed files with 191 additions and 38 deletions
+5 -4
View File
@@ -278,8 +278,9 @@ class CliLaunchServer(Server):
def __init__(self, app_config):
super().__init__(app_config)
def _before_adding_routes(self, app_config):
self.app.config["COMPRESS_MIMETYPES"] = [
@staticmethod
def _before_adding_routes(app, app_config):
app.config["COMPRESS_MIMETYPES"] = [
"text/html",
"text/css",
"text/xml",
@@ -287,9 +288,9 @@ class CliLaunchServer(Server):
"application/javascript",
"application/octet-stream",
]
Compress(self.app)
Compress(app)
if app_config.server__debug:
CORS(self.app, supports_credentials=True)
CORS(app, supports_credentials=True)
@sort_options