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

fixes issues 195 and 192 #197

Merged
merged 6 commits into from
Jul 17, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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