WebClient: add csp nonce to CodeMirror
Signed-off-by: Nicola Murino <nicola.murino@gmail.com>
This commit is contained in:
parent
50a9ac0163
commit
6439569f36
2 changed files with 6 additions and 3 deletions
2
static/vendor/codemirror/cm6.bundle.min.js
vendored
2
static/vendor/codemirror/cm6.bundle.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -156,8 +156,11 @@ explicit grant from the SFTPGo Team (support@sftpgo.com).
|
|||
//{{- if .ReadOnly}}
|
||||
options.readOnly = true;
|
||||
//{{- end}}
|
||||
cmView = cm6.createEditorView(undefined, document.getElementById("editor"));
|
||||
cmView.setState(cm6.createEditorState("{{.Data}}", options));
|
||||
//{{- if .CSPNonce}}
|
||||
options.cspNonce = "{{.CSPNonce}}";
|
||||
//{{- end}}
|
||||
let editorState = cm6.createEditorState("{{.Data}}", options);
|
||||
cmView = cm6.createEditorView(editorState, document.getElementById("editor"));
|
||||
|
||||
var saveBtn = $('#save_button');
|
||||
if (saveBtn){
|
||||
|
|
Loading…
Reference in a new issue