Merge branch 'master' of github.com:xwiki-labs/cryptpad

pull/1/head
yflory 8 years ago
commit 48898c97e5

@ -32,7 +32,7 @@ server {
set $scriptSrc "'self'"; set $scriptSrc "'self'";
set $connectSrc "'self' wss://cryptpad.fr wss://api.cryptpad.fr"; set $connectSrc "'self' wss://cryptpad.fr wss://api.cryptpad.fr";
set $fontSrc "'self'"; set $fontSrc "'self'";
set $imgSrc "data: *"; set $imgSrc "data: * blob:";
set $frameSrc "'self' beta.cryptpad.fr"; set $frameSrc "'self' beta.cryptpad.fr";
if ($uri = /pad/inner.html) { if ($uri = /pad/inner.html) {
@ -65,8 +65,12 @@ server {
rewrite ^.*$ /customize/api/config break; rewrite ^.*$ /customize/api/config break;
} }
location ^~ /blob/ {
try_files $uri =404;
}
## TODO fix in the code so that we don't need this ## TODO fix in the code so that we don't need this
location ~ ^/(register|login|settings|user|pad|drive|poll|slide|code|whiteboard)$ { location ~ ^/(register|login|settings|user|pad|drive|poll|slide|code|whiteboard|file|media)$ {
rewrite ^(.*)$ $1/ redirect; rewrite ^(.*)$ $1/ redirect;
} }

@ -89,6 +89,7 @@ define([
var newU8 = FileCrypto.joinChunks(chunks); var newU8 = FileCrypto.joinChunks(chunks);
FileCrypto.decrypt(newU8, key, function (e, res) { FileCrypto.decrypt(newU8, key, function (e, res) {
if (e) { return console.error(e); }
var title = document.title = res.metadata.name; var title = document.title = res.metadata.name;
myFile = res.content; myFile = res.content;
myDataType = res.metadata.type; myDataType = res.metadata.type;
@ -218,12 +219,15 @@ define([
var key = Nacl.util.decodeBase64(cryptKey); var key = Nacl.util.decodeBase64(cryptKey);
FileCrypto.decrypt(u8, key, function (e, data) { FileCrypto.decrypt(u8, key, function (e, data) {
if (e) {
Cryptpad.removeLoadingScreen();
return console.error(e);
}
console.log(data); console.log(data);
var title = document.title = data.metadata.name; var title = document.title = data.metadata.name;
myFile = data.content; myFile = data.content;
myDataType = data.metadata.type; myDataType = data.metadata.type;
updateTitle(title || defaultName); updateTitle(title || defaultName);
Cryptpad.removeLoadingScreen(); Cryptpad.removeLoadingScreen();
}); });
}); });

Loading…
Cancel
Save