Merge pull request #197 from mozilla/fixes195and192
fixes issues 195 and 192
This commit is contained in:
commit
729f716e97
@ -32,8 +32,8 @@ $(document).ready(function() {
|
||||
$('.percent-number').html(`${Math.floor(percent * 100)}`);
|
||||
if (progress[1] < 1000000) {
|
||||
$('.progress-text').html(
|
||||
`${filename} (${(progress[0] / 1000).toFixed(1)}KB of ${(progress[1] /
|
||||
1000).toFixed(1)}KB)`
|
||||
`${filename} (${(progress[0] / 1000).toFixed(1)}KB of
|
||||
${(progress[1] / 1000).toFixed(1)}KB)`
|
||||
);
|
||||
} else if (progress[1] < 1000000000) {
|
||||
$('.progress-text').html(
|
||||
|
@ -88,7 +88,7 @@ class FileReceiver extends EventEmitter {
|
||||
this.emit('safe', true);
|
||||
return Promise.all([
|
||||
decrypted,
|
||||
fname
|
||||
decodeURIComponent(fname)
|
||||
]);
|
||||
}
|
||||
})
|
||||
|
@ -130,7 +130,7 @@ class FileSender extends EventEmitter {
|
||||
JSON.stringify({
|
||||
aad: arrayToHex(hash),
|
||||
id: fileId,
|
||||
filename: file.name
|
||||
filename: encodeURIComponent(file.name)
|
||||
})
|
||||
);
|
||||
xhr.send(fd);
|
||||
|
@ -98,7 +98,7 @@ app.get('/download/:id', (req, res) => {
|
||||
.length(id)
|
||||
.then(contentLength => {
|
||||
res.render('download', {
|
||||
filename: filename,
|
||||
filename: decodeURIComponent(filename),
|
||||
filesize: bytes(contentLength),
|
||||
trackerId: conf.analytics_id,
|
||||
dsn: conf.sentry_id
|
||||
@ -193,10 +193,10 @@ app.post('/upload', (req, res, next) => {
|
||||
}
|
||||
|
||||
if (
|
||||
!validateIV(meta.id) ||
|
||||
!meta.hasOwnProperty('aad') ||
|
||||
!meta.hasOwnProperty('id') ||
|
||||
!meta.hasOwnProperty('filename')
|
||||
!meta.hasOwnProperty('filename') ||
|
||||
!validateIV(meta.id)
|
||||
) {
|
||||
res.sendStatus(404);
|
||||
return;
|
||||
|
Loading…
Reference in New Issue
Block a user