diff --git a/docker/nginx/conf.dev b/docker/nginx/conf.dev index ea1011924..928f7e682 100644 --- a/docker/nginx/conf.dev +++ b/docker/nginx/conf.dev @@ -83,7 +83,7 @@ http { proxy_pass http://funkwhale-front/front/; } location /front/embed.html { - add_header Content-Security-Policy "default-src 'self'; script-src 'self' unpkg.com 'unsafe-inline' 'unsafe-eval'; style-src https: http: 'self' 'unsafe-inline'; img-src https: http: 'self' data:; font-src https: http: 'self' data:; object-src 'none'; media-src https: http: 'self' data:"; + add_header Content-Security-Policy "connect-src https: http: 'self'; default-src 'self'; script-src 'self' unpkg.com 'unsafe-inline' 'unsafe-eval'; style-src https: http: 'self' 'unsafe-inline'; img-src https: http: 'self' data:; font-src https: http: 'self' data:; object-src 'none'; media-src https: http: 'self' data:"; add_header Referrer-Policy "strict-origin-when-cross-origin"; add_header X-Frame-Options "" always; proxy_pass http://funkwhale-front/front/embed.html; diff --git a/front/public/embed.html b/front/public/embed.html index a3369ca10..001ec2959 100644 --- a/front/public/embed.html +++ b/front/public/embed.html @@ -45,7 +45,7 @@ } if (type === 'artist') { - fetchArtistCover(id) + fetchArtistCover(id).catch(() => undefined) } // Tracks @@ -111,6 +111,7 @@ if (response.status > 299) { switch (response.status) { + case 400: case 404: error.value = `${type} not found.` break @@ -162,7 +163,10 @@ // NOTE: Fetch tracks only if there is no error if (error.value === false) { - fetchTracks() + fetchTracks().catch(err => { + console.error(err) + error.value = `An unknown error occurred while loading ${type} data.` + }) } // Duration