-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
re-add talisman to un-enforce https, csp
- Loading branch information
1 parent
1d8c0fc
commit 44a472e
Showing
2 changed files
with
27 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,6 @@ | ||
import os | ||
import json | ||
import flask | ||
from string import Template | ||
from flask import Blueprint | ||
from sqlalchemy import text | ||
|
@@ -73,7 +74,7 @@ def docs(): | |
<body> | ||
<div id="swagger-ui"></div> | ||
<script src="https://unpkg.com/[email protected]/swagger-ui-bundle.js" crossorigin></script> | ||
<script> | ||
<script nonce="{{ csp_nonce() }}"> | ||
window.onload = () => { | ||
window.ui = SwaggerUIBundle({ | ||
url: '${apiDocUrl}', | ||
|
@@ -84,4 +85,4 @@ def docs(): | |
</body> | ||
</html>""").safe_substitute(apiDocUrl=f"{host}/api-docs") | ||
|
||
return swagger_ui | ||
return flask.render_template_string(swagger_ui) |