format
This commit is contained in:
parent
15ac0e1d49
commit
dd0ab710de
|
@ -19,9 +19,7 @@ class FileReceiver extends EventEmitter {
|
||||||
|
|
||||||
xhr.onload = function(event) {
|
xhr.onload = function(event) {
|
||||||
if (xhr.status === 404) {
|
if (xhr.status === 404) {
|
||||||
reject(
|
reject(new Error('notfound'));
|
||||||
new Error('notfound')
|
|
||||||
);
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,8 @@
|
||||||
/*** index.html ***/
|
/*** index.html ***/
|
||||||
html {
|
html {
|
||||||
background: url('resources/send_bg.svg');
|
background: url('resources/send_bg.svg');
|
||||||
font-family: -apple-system,
|
font-family:
|
||||||
|
-apple-system,
|
||||||
BlinkMacSystemFont,
|
BlinkMacSystemFont,
|
||||||
'SF Pro Text',
|
'SF Pro Text',
|
||||||
Helvetica,
|
Helvetica,
|
||||||
|
|
|
@ -47,10 +47,7 @@ app.use(
|
||||||
'https://sentry.prod.mozaws.net',
|
'https://sentry.prod.mozaws.net',
|
||||||
'https://www.google-analytics.com'
|
'https://www.google-analytics.com'
|
||||||
],
|
],
|
||||||
imgSrc: [
|
imgSrc: ["'self'", 'https://www.google-analytics.com'],
|
||||||
"'self'",
|
|
||||||
'https://www.google-analytics.com'
|
|
||||||
],
|
|
||||||
scriptSrc: ["'self'"],
|
scriptSrc: ["'self'"],
|
||||||
styleSrc: ["'self'", 'https://code.cdn.mozilla.net'],
|
styleSrc: ["'self'", 'https://code.cdn.mozilla.net'],
|
||||||
fontSrc: ["'self'", 'https://code.cdn.mozilla.net'],
|
fontSrc: ["'self'", 'https://code.cdn.mozilla.net'],
|
||||||
|
@ -116,10 +113,10 @@ app.get('/download/:id', (req, res) => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
storage.filename(id).then(filename => {
|
storage
|
||||||
return storage
|
.filename(id)
|
||||||
.length(id)
|
.then(filename => {
|
||||||
.then(contentLength => {
|
return storage.length(id).then(contentLength => {
|
||||||
storage.ttl(id).then(timeToExpiry => {
|
storage.ttl(id).then(timeToExpiry => {
|
||||||
res.render('download', {
|
res.render('download', {
|
||||||
filename: decodeURIComponent(filename),
|
filename: decodeURIComponent(filename),
|
||||||
|
@ -132,7 +129,7 @@ app.get('/download/:id', (req, res) => {
|
||||||
})
|
})
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
res.status(404).render('notfound');
|
res.status(404).render('notfound');
|
||||||
});;
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
app.get('/assets/download/:id', (req, res) => {
|
app.get('/assets/download/:id', (req, res) => {
|
||||||
|
|
Loading…
Reference in New Issue