Skip to content

Commit 4578eee

Browse files
committedFeb 25, 2022
fix
- 修复使用 `https` 协议时文件校验不通过问题 | Fixed an issue where file validation failed when using the `https` protocol. - 修复部分资源文件引用路径问题 | Fixed an issue with some resource file reference paths.
1 parent d14bb32 commit 4578eee

File tree

4 files changed

+176
-173
lines changed

4 files changed

+176
-173
lines changed
 

‎CHANGELOG.md

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
# 更改日志 | CHANGE LOG
22

3+
- 修复使用 `https` 协议时文件校验不通过问题 | Fixed an issue where file validation failed when using the `https` protocol.
4+
- 修复部分资源文件引用路径问题 | Fixed an issue with some resource file reference paths.
5+
36
## v0.1.0/2022-02-24
47

58
- 自动加载块属性 `custom-data-assets` 中设置的资源文件 | The resource file set in the block attribute `custom-data-assets` is automatically loaded.

‎index.html

+37-37
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,8 @@
236236

237237
mxscript(drawDevUrl + './js/PreConfig.js');
238238
mxscript(drawDevUrl + './js/diagramly/Init.js');
239-
mxscript(geBasePath + './Init.js');
240-
mxscript(mxBasePath + './mxClient.js');
239+
mxscript(geBasePath + '/Init.js');
240+
mxscript(mxBasePath + '/mxClient.js');
241241

242242
// Adds all JS code that depends on mxClient. This indirection via Devel.js is
243243
// required in some browsers to make sure mxClient.js (and the files that it
@@ -441,51 +441,51 @@ <h2 id="geStatus">Loading...</h2>
441441

442442
<script type="module">
443443
import {
444-
getBlockAttrs,
445-
} from './siyuan/api.js';
446-
447-
async function open() {
448-
var urlParams = (() => {
449-
var result = new Object();
450-
var params = window.location.search.slice(1).split('&');
451-
for (var i = 0; i < params.length; i++) {
452-
let idx = params[i].indexOf('=');
453-
if (idx > 0) {
454-
result[params[i].substring(0, idx)] = params[i].substring(idx + 1);
444+
getBlockAttrs,
445+
} from './siyuan/api.js';
446+
447+
async function open() {
448+
var urlParams = (() => {
449+
var result = new Object();
450+
var params = window.location.search.slice(1).split('&');
451+
for (var i = 0; i < params.length; i++) {
452+
let idx = params[i].indexOf('=');
453+
if (idx > 0) {
454+
result[params[i].substring(0, idx)] = params[i].substring(idx + 1);
455+
}
455456
}
456-
}
457-
return result;
458-
})();
459-
// console.log(urlParams);
460-
// console.log(window.location);
457+
return result;
458+
})();
459+
// console.log(urlParams);
460+
// console.log(window.location);
461461

462-
var id = urlParams.id;
462+
var id = urlParams.id;
463463

464-
if (id == null) {
465-
let node = window.frameElement != null ? window.frameElement.parentElement.parentElement : null;
466-
if (node != null) {
467-
id = node.getAttribute('data-node-id');
468-
let asset = node.getAttribute('custom-data-assets');
464+
if (id == null) {
465+
let node = window.frameElement != null ? window.frameElement.parentElement.parentElement : null;
466+
if (node != null) {
467+
id = node.getAttribute('data-node-id');
468+
let asset = node.getAttribute('custom-data-assets');
469469

470-
let href = `${window.location.origin}${window.location.pathname}?dev=1&id=${id}#U${window.location.origin}/${asset}`;
471-
// console.log(href);
472-
window.location.href = href;
473-
}
474-
} else {
475-
if (window.location.hash == '') {
476-
let data = await getBlockAttrs(id);
477-
// console.log(data);
478-
let asset = data['custom-data-assets'];
479-
if (asset != null) {
480470
let href = `${window.location.origin}${window.location.pathname}?dev=1&id=${id}#U${window.location.origin}/${asset}`;
481471
// console.log(href);
482472
window.location.href = href;
483473
}
474+
} else {
475+
if (window.location.hash == '') {
476+
let data = await getBlockAttrs(id);
477+
// console.log(data);
478+
let asset = data['custom-data-assets'];
479+
if (asset != null) {
480+
let href = `${window.location.origin}${window.location.pathname}?dev=1&id=${id}#U${window.location.origin}/${asset}`;
481+
// console.log(href);
482+
window.location.href = href;
483+
}
484+
}
484485
}
485486
}
486-
}
487-
// console.log(window.location);
488-
setTimeout(open, 0);
487+
// console.log(window.location);
488+
setTimeout(open, 0);
489489
</script>
490490

491491
</html>

‎js/diagramly/App.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -643,7 +643,7 @@ App.main = function(callback, createUi)
643643
{
644644
var content = mxUtils.getTextContent(scripts[0]);
645645

646-
if (CryptoJS.MD5(content).toString() != '8445baab47ce600df0a216ded2e4ba30')
646+
if (CryptoJS.MD5(content).toString() != '8d30a606a5a4d5fb5186a4989593c4bd')
647647
{
648648
console.log('Change bootstrap script MD5 in the previous line:', CryptoJS.MD5(content).toString());
649649
alert('[Dev] Bootstrap script change requires update of CSP');

‎js/diagramly/Devel.js

+135-135
Original file line numberDiff line numberDiff line change
@@ -6,150 +6,150 @@
66
* is used for development mode where the JS is in separate
77
* files and the mxClient.js loads other files.
88
*/
9-
if (!mxIsElectron && location.protocol !== 'http:')
10-
{
11-
(function()
12-
{
13-
var hashes = 'default-src \'self\'; ' +
14-
// storage.googleapis.com is needed for workbox-service-worker
15-
'script-src %script-src% \'self\' https://viewer.diagrams.net https://storage.googleapis.com ' +
16-
'https://apis.google.com https://*.pusher.com ' +
17-
// Below are the SHAs of the two script blocks in index.html.
18-
// These must be updated here and in the CDN after changes.
19-
//----------------------------------------------------------//
20-
//------------- Bootstrap script in index.html -------------//
21-
//----------------------------------------------------------//
22-
// Version 16.4.4
23-
'\'sha256-AVuOIxynOo/05KDLjyp0AoBE+Gt/KE1/vh2pS+yfqes=\' ' +
24-
// Version 15.8.3
25-
'\'sha256-r/ILW7KMSJxeo9EYqCTzZyCT0PZ9gHN1BLgki7vpR+A=\' ' +
26-
// Version 14.6.5
27-
'\'sha256-5DtSB5mj34lxcEf+HFWbBLEF49xxJaKnWGDWa/utwQA=\' ' +
28-
//---------------------------------------------------------//
29-
//------------- App.main script in index.html -------------//
30-
//---------------------------------------------------------//
31-
// Version 13.8.2
32-
'\'sha256-vS/MxlVD7nbY7AnV+0t1Ap338uF7vrcs7y23KjERhKc=\' ' +
33-
//---------------------------------------------------------//
34-
'; ';
9+
// if (!mxIsElectron && location.protocol !== 'http:')
10+
// {
11+
// (function()
12+
// {
13+
// var hashes = 'default-src \'self\'; ' +
14+
// // storage.googleapis.com is needed for workbox-service-worker
15+
// 'script-src %script-src% \'self\' https://viewer.diagrams.net https://storage.googleapis.com ' +
16+
// 'https://apis.google.com https://*.pusher.com ' +
17+
// // Below are the SHAs of the two script blocks in index.html.
18+
// // These must be updated here and in the CDN after changes.
19+
// //----------------------------------------------------------//
20+
// //------------- Bootstrap script in index.html -------------//
21+
// //----------------------------------------------------------//
22+
// // Version 16.4.4
23+
// '\'sha256-AVuOIxynOo/05KDLjyp0AoBE+Gt/KE1/vh2pS+yfqes=\' ' +
24+
// // Version 15.8.3
25+
// '\'sha256-r/ILW7KMSJxeo9EYqCTzZyCT0PZ9gHN1BLgki7vpR+A=\' ' +
26+
// // Version 14.6.5
27+
// '\'sha256-5DtSB5mj34lxcEf+HFWbBLEF49xxJaKnWGDWa/utwQA=\' ' +
28+
// //---------------------------------------------------------//
29+
// //------------- App.main script in index.html -------------//
30+
// //---------------------------------------------------------//
31+
// // Version 13.8.2
32+
// '\'sha256-vS/MxlVD7nbY7AnV+0t1Ap338uF7vrcs7y23KjERhKc=\' ' +
33+
// //---------------------------------------------------------//
34+
// '; ';
3535

36-
var styleHashes = '\'sha256-JjkxVHHCCVO0nllPD6hU8bBYSlsikA8TM/o3fhr0bas=\' ' + // index.html
37-
'\'sha256-1F7QEyp3oiW4n2eXlhilLpu+H5Wdj4t90pKtEyK/mFE=\' ' + // Minimal.js/Light
38-
'\'sha256-V8wOMdVocmGIO0DHZHJsKN6viAFJOJRbsJ7UhdJlmng=\' ' + // Minimal.js/Dark
39-
'\'sha256-7kY8ozVqKLIIBwZ24dhdmZkM26PsOlZmEi72RhmZKoM=\' ' + // mxTooltipHandler.js
40-
'\'sha256-01chdey79TzZe4ihnvvUXXI5y8MklIcKH+vzDdQvsuU=\' ' + // Editor.js/mathJaxWebkitCss
41-
'\'sha256-fGbXK7EYpvNRPca81zPnqJHi2y+34KSgAcZv8mhaSzI=\' ' + // MathJax.js
42-
'\'sha256-3hENQqEWUBxdkmJp2kQ2+G0F8NVGzFAVkW5vWDo7ONk=\' ' + // MathJax.js
43-
'\'sha256-Z4u/cxrZPHjN20CIXZHTKr+VlqVxrWG8cbbeC2zmPqI=\' ' + // MathJax.js
44-
'\'sha256-LDMABiyg2T48kuAV9ouqNCSEqf2OkUdlZK9D9CeZHBs=\' ' + // MathJax.js
45-
'\'sha256-XQfwbaSNgLzro3IzkwT0uZLAiBvZzajo0QZx7oW158E=\' ' + // MathJax.js
46-
'\'sha256-++XCePvZXKdegIqkwtbudr16Jx87KFh4t/t7UxsbHpw=\' ' + // MathJax.js
47-
'\'sha256-v9NOL6IswMbY7zpRZjxkYujhuGRVvZtp1c1MfdnToB4=\' ' + // MathJax.js
48-
'\'sha256-5xtuTr9UuyJoTQ76CNLzvSJjS7onwfq73B2rLWCl3aE=\' ' + // MathJax.js
49-
'\'sha256-W21B506Ri8aGW3T87iawssPz71NvvbYZfBfzDbBSArU=\' ' + // MathJax.js
50-
'\'sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=\' ' + // spin.min.js
51-
'\'sha256-nzHi23DROym7G011m6y0DyDd9mvQL2hSJ0Gy3g2T/5Q=\' ' + // dropins.js
52-
'\'sha256-76P1PZLzT12kfw2hkrLn5vu/cWZgcOYuSYU3RT3rXKA=\' ' + // gapi
53-
'\'unsafe-hashes\'; '; // Required for hashes for style attribute
36+
// var styleHashes = '\'sha256-JjkxVHHCCVO0nllPD6hU8bBYSlsikA8TM/o3fhr0bas=\' ' + // index.html
37+
// '\'sha256-1F7QEyp3oiW4n2eXlhilLpu+H5Wdj4t90pKtEyK/mFE=\' ' + // Minimal.js/Light
38+
// '\'sha256-V8wOMdVocmGIO0DHZHJsKN6viAFJOJRbsJ7UhdJlmng=\' ' + // Minimal.js/Dark
39+
// '\'sha256-7kY8ozVqKLIIBwZ24dhdmZkM26PsOlZmEi72RhmZKoM=\' ' + // mxTooltipHandler.js
40+
// '\'sha256-01chdey79TzZe4ihnvvUXXI5y8MklIcKH+vzDdQvsuU=\' ' + // Editor.js/mathJaxWebkitCss
41+
// '\'sha256-fGbXK7EYpvNRPca81zPnqJHi2y+34KSgAcZv8mhaSzI=\' ' + // MathJax.js
42+
// '\'sha256-3hENQqEWUBxdkmJp2kQ2+G0F8NVGzFAVkW5vWDo7ONk=\' ' + // MathJax.js
43+
// '\'sha256-Z4u/cxrZPHjN20CIXZHTKr+VlqVxrWG8cbbeC2zmPqI=\' ' + // MathJax.js
44+
// '\'sha256-LDMABiyg2T48kuAV9ouqNCSEqf2OkUdlZK9D9CeZHBs=\' ' + // MathJax.js
45+
// '\'sha256-XQfwbaSNgLzro3IzkwT0uZLAiBvZzajo0QZx7oW158E=\' ' + // MathJax.js
46+
// '\'sha256-++XCePvZXKdegIqkwtbudr16Jx87KFh4t/t7UxsbHpw=\' ' + // MathJax.js
47+
// '\'sha256-v9NOL6IswMbY7zpRZjxkYujhuGRVvZtp1c1MfdnToB4=\' ' + // MathJax.js
48+
// '\'sha256-5xtuTr9UuyJoTQ76CNLzvSJjS7onwfq73B2rLWCl3aE=\' ' + // MathJax.js
49+
// '\'sha256-W21B506Ri8aGW3T87iawssPz71NvvbYZfBfzDbBSArU=\' ' + // MathJax.js
50+
// '\'sha256-47DEQpj8HBSa+/TImW+5JCeuQeRkm5NMpJWZG3hSuFU=\' ' + // spin.min.js
51+
// '\'sha256-nzHi23DROym7G011m6y0DyDd9mvQL2hSJ0Gy3g2T/5Q=\' ' + // dropins.js
52+
// '\'sha256-76P1PZLzT12kfw2hkrLn5vu/cWZgcOYuSYU3RT3rXKA=\' ' + // gapi
53+
// '\'unsafe-hashes\'; '; // Required for hashes for style attribute
5454

55-
var directives = 'connect-src %connect-src% \'self\' https://*.draw.io https://*.diagrams.net ' +
56-
'https://*.googleapis.com wss://p2p-collab-test.jgraph.workers.dev wss://*.pusher.com https://*.pusher.com ' +
57-
'https://api.github.com https://raw.githubusercontent.com https://gitlab.com ' +
58-
'https://graph.microsoft.com https://*.sharepoint.com https://*.1drv.com https://api.onedrive.com ' +
59-
'https://dl.dropboxusercontent.com ' +
60-
'https://*.google.com https://fonts.gstatic.com https://fonts.googleapis.com; ' +
61-
// font-src about: is required for MathJax HTML-CSS output with STIX
62-
'img-src * data: blob:; media-src * data:; font-src * about:; ' +
63-
// www.draw.io required for browser data migration to app.diagrams.net and
64-
// viewer.diagrams.net required for iframe embed preview
65-
'frame-src %frame-src% \'self\' https://viewer.diagrams.net https://www.draw.io https://*.google.com; ' +
66-
'style-src %style-src% \'self\' https://fonts.googleapis.com ' +
67-
// Replaces unsafe-inline style-src with hashes with safe-style-src URL parameter
68-
((urlParams['safe-style-src'] == '1') ? styleHashes : '\'unsafe-inline\'; ') +
69-
'base-uri \'none\';' +
70-
'child-src \'self\';' +
71-
'object-src \'none\';';
55+
// var directives = 'connect-src %connect-src% \'self\' https://*.draw.io https://*.diagrams.net ' +
56+
// 'https://*.googleapis.com wss://p2p-collab-test.jgraph.workers.dev wss://*.pusher.com https://*.pusher.com ' +
57+
// 'https://api.github.com https://raw.githubusercontent.com https://gitlab.com ' +
58+
// 'https://graph.microsoft.com https://*.sharepoint.com https://*.1drv.com https://api.onedrive.com ' +
59+
// 'https://dl.dropboxusercontent.com ' +
60+
// 'https://*.google.com https://fonts.gstatic.com https://fonts.googleapis.com; ' +
61+
// // font-src about: is required for MathJax HTML-CSS output with STIX
62+
// 'img-src * data: blob:; media-src * data:; font-src * about:; ' +
63+
// // www.draw.io required for browser data migration to app.diagrams.net and
64+
// // viewer.diagrams.net required for iframe embed preview
65+
// 'frame-src %frame-src% \'self\' https://viewer.diagrams.net https://www.draw.io https://*.google.com; ' +
66+
// 'style-src %style-src% \'self\' https://fonts.googleapis.com ' +
67+
// // Replaces unsafe-inline style-src with hashes with safe-style-src URL parameter
68+
// ((urlParams['safe-style-src'] == '1') ? styleHashes : '\'unsafe-inline\'; ') +
69+
// 'base-uri \'none\';' +
70+
// 'child-src \'self\';' +
71+
// 'object-src \'none\';';
7272

73-
var csp = hashes + directives;
74-
var devCsp = csp.
75-
// Adds script tags and loads shapes with eval
76-
replace(/%script-src%/g, 'https://www.dropbox.com https://api.trello.com https://devhost.jgraph.com \'unsafe-eval\'').
77-
// Adds Trello and Dropbox backend storage
78-
replace(/%connect-src%/g, 'https://*.dropboxapi.com https://trello.com https://api.trello.com').
79-
// Loads common.css from mxgraph
80-
replace(/%style-src%/g, 'https://devhost.jgraph.com').
81-
replace(/%frame-src%/g, '').
82-
replace(/ /g, ' ');
73+
// var csp = hashes + directives;
74+
// var devCsp = csp.
75+
// // Adds script tags and loads shapes with eval
76+
// replace(/%script-src%/g, 'https://www.dropbox.com https://api.trello.com https://devhost.jgraph.com \'unsafe-eval\'').
77+
// // Adds Trello and Dropbox backend storage
78+
// replace(/%connect-src%/g, 'https://*.dropboxapi.com https://trello.com https://api.trello.com').
79+
// // Loads common.css from mxgraph
80+
// replace(/%style-src%/g, 'https://devhost.jgraph.com').
81+
// replace(/%frame-src%/g, '').
82+
// replace(/ /g, ' ');
8383

84-
mxmeta(null, devCsp, 'Content-Security-Policy');
84+
// mxmeta(null, devCsp, 'Content-Security-Policy');
8585

86-
if (urlParams['print-csp'] == '1')
87-
{
88-
console.log('Content-Security-Policy');
89-
var app_diagrams_net = csp.replace(/%script-src%/g, 'https://www.dropbox.com https://api.trello.com').
90-
replace(/%connect-src%/g, 'https://*.dropboxapi.com https://api.trello.com').
91-
replace(/%frame-src%/g, '').
92-
replace(/%style-src%/g, '').
93-
replace(/ /g, ' ') + ' frame-ancestors \'self\' https://teams.microsoft.com;';
94-
console.log('app.diagrams.net:', app_diagrams_net);
86+
// if (urlParams['print-csp'] == '1')
87+
// {
88+
// console.log('Content-Security-Policy');
89+
// var app_diagrams_net = csp.replace(/%script-src%/g, 'https://www.dropbox.com https://api.trello.com').
90+
// replace(/%connect-src%/g, 'https://*.dropboxapi.com https://api.trello.com').
91+
// replace(/%frame-src%/g, '').
92+
// replace(/%style-src%/g, '').
93+
// replace(/ /g, ' ') + ' frame-ancestors \'self\' https://teams.microsoft.com;';
94+
// console.log('app.diagrams.net:', app_diagrams_net);
9595

96-
var se_diagrams_net = hashes.replace(/%script-src%/g, '') +
97-
'connect-src \'self\' https://*.diagrams.net ' +
98-
'https://*.googleapis.com wss://*.pusher.com https://*.pusher.com ' +
99-
'https://*.google.com https://fonts.gstatic.com https://fonts.googleapis.com; ' +
100-
'img-src * data: blob:; media-src * data:; font-src * about:; ' +
101-
'frame-src \'self\' https://viewer.diagrams.net https://*.google.com; ' +
102-
'style-src \'self\' https://fonts.googleapis.com ' + styleHashes + ' ' +
103-
'object-src \'none\';' +
104-
'frame-src \'none\';' +
105-
'worker-src https://se.diagrams.net/service-worker.js;'
106-
console.log('se.diagrams.net:', se_diagrams_net);
96+
// var se_diagrams_net = hashes.replace(/%script-src%/g, '') +
97+
// 'connect-src \'self\' https://*.diagrams.net ' +
98+
// 'https://*.googleapis.com wss://*.pusher.com https://*.pusher.com ' +
99+
// 'https://*.google.com https://fonts.gstatic.com https://fonts.googleapis.com; ' +
100+
// 'img-src * data: blob:; media-src * data:; font-src * about:; ' +
101+
// 'frame-src \'self\' https://viewer.diagrams.net https://*.google.com; ' +
102+
// 'style-src \'self\' https://fonts.googleapis.com ' + styleHashes + ' ' +
103+
// 'object-src \'none\';' +
104+
// 'frame-src \'none\';' +
105+
// 'worker-src https://se.diagrams.net/service-worker.js;'
106+
// console.log('se.diagrams.net:', se_diagrams_net);
107107

108-
// TODO remove https://ajax.googleapis.com April 2022. It's old jquery domain
109-
var ac_draw_io = csp.replace(/%script-src%/g, 'https://aui-cdn.atlassian.com https://connect-cdn.atl-paas.net https://ajax.googleapis.com https://cdnjs.cloudflare.com').
110-
replace(/%frame-src%/g, 'https://www.lucidchart.com https://app.lucidchart.com https://lucid.app blob:').
111-
replace(/%style-src%/g, 'https://aui-cdn.atlassian.com https://*.atlassian.net').
112-
replace(/%connect-src%/g, '').
113-
replace(/ /g, ' ');
114-
console.log('ac.draw.io:', ac_draw_io);
108+
// // TODO remove https://ajax.googleapis.com April 2022. It's old jquery domain
109+
// var ac_draw_io = csp.replace(/%script-src%/g, 'https://aui-cdn.atlassian.com https://connect-cdn.atl-paas.net https://ajax.googleapis.com https://cdnjs.cloudflare.com').
110+
// replace(/%frame-src%/g, 'https://www.lucidchart.com https://app.lucidchart.com https://lucid.app blob:').
111+
// replace(/%style-src%/g, 'https://aui-cdn.atlassian.com https://*.atlassian.net').
112+
// replace(/%connect-src%/g, '').
113+
// replace(/ /g, ' ');
114+
// console.log('ac.draw.io:', ac_draw_io);
115115

116-
var aj_draw_io = csp.replace(/%script-src%/g, 'https://connect-cdn.atl-paas.net').
117-
replace(/%frame-src%/g, 'blob:').
118-
replace(/%style-src%/g, 'https://aui-cdn.atlassian.com https://*.atlassian.net').
119-
replace(/%connect-src%/g, 'https://api.atlassian.com https://api.media.atlassian.com').
120-
replace(/ /g, ' ');
121-
console.log('aj.draw.io:', aj_draw_io);
116+
// var aj_draw_io = csp.replace(/%script-src%/g, 'https://connect-cdn.atl-paas.net').
117+
// replace(/%frame-src%/g, 'blob:').
118+
// replace(/%style-src%/g, 'https://aui-cdn.atlassian.com https://*.atlassian.net').
119+
// replace(/%connect-src%/g, 'https://api.atlassian.com https://api.media.atlassian.com').
120+
// replace(/ /g, ' ');
121+
// console.log('aj.draw.io:', aj_draw_io);
122122

123-
console.log('import.diagrams.net:', 'default-src \'self\'; worker-src blob:; img-src \'self\' blob: data: https://www.lucidchart.com ' +
124-
'https://app.lucidchart.com https://lucid.app; style-src \'self\' \'unsafe-inline\'; frame-src https://www.lucidchart.com https://app.lucidchart.com https://lucid.app;');
125-
console.log('Development:', devCsp);
123+
// console.log('import.diagrams.net:', 'default-src \'self\'; worker-src blob:; img-src \'self\' blob: data: https://www.lucidchart.com ' +
124+
// 'https://app.lucidchart.com https://lucid.app; style-src \'self\' \'unsafe-inline\'; frame-src https://www.lucidchart.com https://app.lucidchart.com https://lucid.app;');
125+
// console.log('Development:', devCsp);
126126

127-
console.log('Header Worker:', 'let securityHeaders =', JSON.stringify({
128-
online: {
129-
"Content-Security-Policy" : app_diagrams_net,
130-
"Permissions-Policy" : "microphone=()"
131-
},
132-
se: {
133-
"Content-Security-Policy" : se_diagrams_net,
134-
"Permissions-Policy" : "microphone=()",
135-
"Access-Control-Allow-Origin": "https://se.diagrams.net"
136-
},
137-
teams: {
138-
"Content-Security-Policy" : app_diagrams_net.replace(/ 'sha256-[^']+'/g, ''),
139-
"Permissions-Policy" : "microphone=()"
140-
},
141-
jira: {
142-
"Content-Security-Policy" : aj_draw_io,
143-
"Permissions-Policy" : "microphone=()"
144-
},
145-
conf: {
146-
"Content-Security-Policy" : ac_draw_io,
147-
"Permissions-Policy" : "microphone=()"
148-
}
149-
}, null, 4));
150-
}
151-
})();
152-
}
127+
// console.log('Header Worker:', 'let securityHeaders =', JSON.stringify({
128+
// online: {
129+
// "Content-Security-Policy" : app_diagrams_net,
130+
// "Permissions-Policy" : "microphone=()"
131+
// },
132+
// se: {
133+
// "Content-Security-Policy" : se_diagrams_net,
134+
// "Permissions-Policy" : "microphone=()",
135+
// "Access-Control-Allow-Origin": "https://se.diagrams.net"
136+
// },
137+
// teams: {
138+
// "Content-Security-Policy" : app_diagrams_net.replace(/ 'sha256-[^']+'/g, ''),
139+
// "Permissions-Policy" : "microphone=()"
140+
// },
141+
// jira: {
142+
// "Content-Security-Policy" : aj_draw_io,
143+
// "Permissions-Policy" : "microphone=()"
144+
// },
145+
// conf: {
146+
// "Content-Security-Policy" : ac_draw_io,
147+
// "Permissions-Policy" : "microphone=()"
148+
// }
149+
// }, null, 4));
150+
// }
151+
// })();
152+
// }
153153

154154
mxscript(drawDevUrl + 'js/cryptojs/aes.min.js');
155155
mxscript(drawDevUrl + 'js/spin/spin.min.js');
@@ -308,4 +308,4 @@ if (urlParams['orgChartDev'] == '1')
308308
mxscript(drawDevUrl + 'js/orgchart/bridge.collections.min.js');
309309
mxscript(drawDevUrl + 'js/orgchart/OrgChart.Layout.min.js');
310310
mxscript(drawDevUrl + 'js/orgchart/mxOrgChartLayout.js');
311-
}
311+
}

0 commit comments

Comments
 (0)
Please sign in to comment.