Fix CSP issues for missing files (404)
This commit is contained in:
@@ -65,6 +65,7 @@ define([
|
||||
xhr.setRequestHeader('Range', 'bytes=0-1');
|
||||
xhr.responseType = 'arraybuffer';
|
||||
|
||||
xhr.onerror= function () { return CB('XHR_ERROR'); };
|
||||
xhr.onload = function () {
|
||||
if (/^4/.test('' + this.status)) { return CB('XHR_ERROR'); }
|
||||
var res = new Uint8Array(xhr.response);
|
||||
|
||||
@@ -95,7 +95,9 @@ define([
|
||||
FileCrypto.fetchDecryptedMetadata(src, key, function (e, metadata) {
|
||||
if (e) {
|
||||
if (e === 'XHR_ERROR') {
|
||||
return void UI.errorLoadingScreen(Messages.download_resourceNotAvailable);
|
||||
return void UI.errorLoadingScreen(Messages.download_resourceNotAvailable, false, function () {
|
||||
common.gotoURL('/file/');
|
||||
});
|
||||
}
|
||||
return void console.error(e);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user