openvibers/openvibe.surf Commits

Allow Network session checks on Surf (#145)

OP OpenVibers committed 3 days ago · f28205afd6 · 2 files, +2 −1

Changes

ddiff --git a/server/app.js b/server/app.js
iindex 372bfa3..0c793be 100644
---- a/server/app.js
++++ b/server/app.js
@@@ -101,7 +101,7 @@ function createApp(opts = {}) {
// hls.js fetches Media's playlists and segments, which may redirect to R2 or B2 (as openvibe.video's CSP).
connectSrc: ["'self'", 'https://openvibe.network', 'https://openvibe.chat', 'https://cloudflareinsights.com', 'https://openvibe.events', 'https://openvibe.media', 'https://edge.openvibe.media', 'https://*.r2.cloudflarestorage.com', 'https://*.backblazeb2.com'],
// Ride embeds a Games map; Watch may embed Live's player when Live has one.
-- frameSrc: ["'self'", 'https://openvibe.games', 'https://openvibe.live'],
++ frameSrc: ["'self'", 'https://openvibe.games', 'https://openvibe.live', 'https://openvibe.network'],
// HLS clips play from the media edge (and a blob: URL a player may build).
mediaSrc: ["'self'", 'https://openvibe.media', 'https://edge.openvibe.media', 'https://*.r2.cloudflarestorage.com', 'https://*.backblazeb2.com', 'blob:'],
frameAncestors: ["'none'"],
ddiff --git a/test/pages.test.js b/test/pages.test.js
iindex fc21543..a5578f4 100644
---- a/test/pages.test.js
++++ b/test/pages.test.js
@@@ -186,6 +186,7 @@ const { assetVersion } = require('../server/assets');
const r = await t.get('/');
const csp = r.headers.get('content-security-policy') || '';
assert.match(csp, /frame-src 'self' https:\/\/openvibe\.games https:\/\/openvibe\.live/);
++ assert.match(csp, /frame-src[^;]* https:\/\/openvibe\.network(?:;|$)/, 'the navbar may check Network on a typed arrival');
assert.match(csp, /media-src 'self' https:\/\/openvibe\.media https:\/\/edge\.openvibe\.media https:\/\/\*\.r2\.cloudflarestorage\.com https:\/\/\*\.backblazeb2\.com blob:/);
assert.match(csp, /connect-src [^;]*https:\/\/openvibe\.media/, 'hls.js fetches Media\'s playlists and segments');
// OpenVibe.Chat too: the navbar's Messages count (openvibe-shared 4.130.0).