Fix CSP for remote instances

environments/review-front-wvff-cfe5gn/deployments/13838
wvffle 2022-09-26 18:34:13 +00:00
rodzic 50fd01de1a
commit 306a2e9738
2 zmienionych plików z 7 dodań i 3 usunięć

Wyświetl plik

@ -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;

Wyświetl plik

@ -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