Fix CSP for remote instances
This commit is contained in:
parent
50fd01de1a
commit
306a2e9738
|
@ -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;
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue