Skip to content
This repository has been archived by the owner on May 22, 2021. It is now read-only.

Commit

Permalink
Merge pull request #197 from mozilla/fixes195and192
Browse files Browse the repository at this point in the history
fixes issues 195 and 192
  • Loading branch information
abhinadduri committed Jul 17, 2017
2 parents 9735aa6 + 93d2e91 commit 729f716
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions frontend/src/download.js
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/fileReceiver.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ class FileReceiver extends EventEmitter {
this.emit('safe', true);
return Promise.all([
decrypted,
fname
decodeURIComponent(fname)
]);
}
})
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/fileSender.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 3 additions & 3 deletions server/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 729f716

Please sign in to comment.