refine the header fixes for chrome to avoid breaking standalone instances

pull/1/head
ansuz 4 years ago
parent 8aaa44beeb
commit 3a0fe6968d

@ -43,6 +43,7 @@ var canonicalizeOrigin = function (s) {
}
if (typeof(config.httpSafeOrigin) !== 'string') {
Env.NO_SANDBOX = true;
if (typeof(config.httpSafePort) !== 'number') {
config.httpSafePort = config.httpPort + 1;
}
@ -112,7 +113,14 @@ var setHeaders = (function () {
// Don't set CSP headers on /api/config because they aren't necessary and they cause problems
// when duplicated by NGINX in production environments
if (/^\/api\/(broadcast|config)/.test(req.url)) { return; }
if (/^\/api\/(broadcast|config)/.test(req.url)) {
if (!Env.NO_SANDBOX) {
applyHeaderMap(res, {
"Cross-Origin-Resource-Policy": 'cross-origin',
});
}
return;
}
applyHeaderMap(res, {
"Cross-Origin-Resource-Policy": 'cross-origin',
});

Loading…
Cancel
Save