Fix CSP issues for missing files (404)

pull/1/head
yflory 7 years ago
parent 9fbf507cda
commit 01a3c13a8c

@ -618,7 +618,7 @@ define(function () {
out.upload_mustLogin = "Vous devez vous connecter pour importer un fichier";
out.download_button = "Déchiffrer et télécharger";
out.download_mt_button = "Télécharger";
out.download_resourceNotAvailable = "Le fichier demandé n'est pas disponible...";
out.download_resourceNotAvailable = "Le fichier demandé n'est pas disponible... Appuyez sur Échap pour continuer.";
out.todo_title = "CryptTodo";
out.todo_newTodoNamePlaceholder = "Décrivez votre tâche...";

@ -622,7 +622,7 @@ define(function () {
out.upload_mustLogin = "You must be logged in to upload files";
out.download_button = "Decrypt & Download";
out.download_mt_button = "Download";
out.download_resourceNotAvailable = "The requested resource was not available...";
out.download_resourceNotAvailable = "The requested resource was not available... Press Esc to continue.";
out.todo_title = "CryptTodo";
out.todo_newTodoNamePlaceholder = "Describe your task...";

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

Loading…
Cancel
Save