openvibers/openvibe.studio Commits
Allow Network session checks on Studio (#40)
Changes
@@@ -47,7 +47,7 @@ function createApp(opts = {}) {fontSrc: ["'self'", 'data:', 'https://fonts.gstatic.com'],imgSrc: ["'self'", 'data:', 'https://openvibe.network', 'https://openvibe.media'],connectSrc: ["'self'", 'https://openvibe.network', 'https://openvibe.download', 'https://openvibe.pics', 'https://cloudflareinsights.com', 'https://openvibe.events'],-- frameSrc: ["'self'"],++ frameSrc: ["'self'", 'https://openvibe.network'],frameAncestors: ["'none'"],objectSrc: ["'none'"],workerSrc: ["'self'", 'blob:'],@@@ -245,6 +245,7 @@ test('the app catalogue, the attribution page and the small endpoints answer', aassert.match((await fetch(s.base + '/')).headers.get('content-security-policy') || '', /connect-src[^;]*https:\/\/openvibe\.events/);// Avatars are served from openvibe.media (the Network's /avatar/<name> redirects there): img-src must let them show.assert.match((await fetch(s.base + '/')).headers.get('content-security-policy') || '', /img-src[^;]*https:\/\/openvibe\.media(?:[ ;]|$)/);++ assert.match((await fetch(s.base + '/')).headers.get('content-security-policy') || '', /frame-src 'self' https:\/\/openvibe\.network(?:;|$)/);assert.equal((await fetch(s.base + '/nope')).status, 404);});
@@ -47,7 +47,7 @@ function createApp(opts = {}) {
@@ -47,7 +47,7 @@ function createApp(opts = {}) {
fontSrc: ["'self'", 'data:', 'https://fonts.gstatic.com'],
fontSrc: ["'self'", 'data:', 'https://fonts.gstatic.com'],
imgSrc: ["'self'", 'data:', 'https://openvibe.network', 'https://openvibe.media'],
imgSrc: ["'self'", 'data:', 'https://openvibe.network', 'https://openvibe.media'],
connectSrc: ["'self'", 'https://openvibe.network', 'https://openvibe.download', 'https://openvibe.pics', 'https://cloudflareinsights.com', 'https://openvibe.events'],
connectSrc: ["'self'", 'https://openvibe.network', 'https://openvibe.download', 'https://openvibe.pics', 'https://cloudflareinsights.com', 'https://openvibe.events'],
- frameSrc: ["'self'"],
+ frameSrc: ["'self'", 'https://openvibe.network'],
frameAncestors: ["'none'"],
frameAncestors: ["'none'"],
objectSrc: ["'none'"],
objectSrc: ["'none'"],
workerSrc: ["'self'", 'blob:'],
workerSrc: ["'self'", 'blob:'],
@@ -245,6 +245,7 @@ test('the app catalogue, the attribution page and the small endpoints answer', a
@@ -245,6 +245,7 @@ test('the app catalogue, the attribution page and the small endpoints answer', a
assert.match((await fetch(s.base + '/')).headers.get('content-security-policy') || '', /connect-src[^;]*https:\/\/openvibe\.events/);
assert.match((await fetch(s.base + '/')).headers.get('content-security-policy') || '', /connect-src[^;]*https:\/\/openvibe\.events/);
// Avatars are served from openvibe.media (the Network's /avatar/<name> redirects there): img-src must let them show.
// Avatars are served from openvibe.media (the Network's /avatar/<name> redirects there): img-src must let them show.
assert.match((await fetch(s.base + '/')).headers.get('content-security-policy') || '', /img-src[^;]*https:\/\/openvibe\.media(?:[ ;]|$)/);
assert.match((await fetch(s.base + '/')).headers.get('content-security-policy') || '', /img-src[^;]*https:\/\/openvibe\.media(?:[ ;]|$)/);
+ assert.match((await fetch(s.base + '/')).headers.get('content-security-policy') || '', /frame-src 'self' https:\/\/openvibe\.network(?:;|$)/);
assert.equal((await fetch(s.base + '/nope')).status, 404);
assert.equal((await fetch(s.base + '/nope')).status, 404);
});
});