This commit is contained in:
Danny Coates 2017-07-25 12:08:37 -07:00
parent 15ac0e1d49
commit dd0ab710de
No known key found for this signature in database
GPG Key ID: 4C442633C62E00CB
4 changed files with 14 additions and 18 deletions

View File

@ -19,9 +19,7 @@ class FileReceiver extends EventEmitter {
xhr.onload = function(event) {
if (xhr.status === 404) {
reject(
new Error('notfound')
);
reject(new Error('notfound'));
return;
}

View File

@ -1,7 +1,8 @@
/*** index.html ***/
html {
background: url('resources/send_bg.svg');
font-family: -apple-system,
font-family:
-apple-system,
BlinkMacSystemFont,
'SF Pro Text',
Helvetica,

View File

@ -47,10 +47,7 @@ app.use(
'https://sentry.prod.mozaws.net',
'https://www.google-analytics.com'
],
imgSrc: [
"'self'",
'https://www.google-analytics.com'
],
imgSrc: ["'self'", 'https://www.google-analytics.com'],
scriptSrc: ["'self'"],
styleSrc: ["'self'", 'https://code.cdn.mozilla.net'],
fontSrc: ["'self'", 'https://code.cdn.mozilla.net'],
@ -116,10 +113,10 @@ app.get('/download/:id', (req, res) => {
return;
}
storage.filename(id).then(filename => {
return storage
.length(id)
.then(contentLength => {
storage
.filename(id)
.then(filename => {
return storage.length(id).then(contentLength => {
storage.ttl(id).then(timeToExpiry => {
res.render('download', {
filename: decodeURIComponent(filename),
@ -132,7 +129,7 @@ app.get('/download/:id', (req, res) => {
})
.catch(() => {
res.status(404).render('notfound');
});;
});
});
app.get('/assets/download/:id', (req, res) => {