mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-09 19:55:34 +00:00
format
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
const conf = require('./config.js');
|
||||
|
||||
const isProduction = conf.env === 'production'
|
||||
const isProduction = conf.env === 'production';
|
||||
|
||||
const mozlog = require('mozlog')({
|
||||
app: 'FirefoxFileshare',
|
||||
|
||||
@@ -78,10 +78,10 @@ app.get('/assets/download/:id', (req, res) => {
|
||||
return;
|
||||
}
|
||||
|
||||
storage.metadata(id)
|
||||
storage
|
||||
.metadata(id)
|
||||
.then(meta => {
|
||||
storage.length(id).then(contentLength => {
|
||||
|
||||
res.writeHead(200, {
|
||||
'Content-Disposition': 'attachment; filename=' + meta.filename,
|
||||
'Content-Type': 'application/octet-stream',
|
||||
@@ -142,7 +142,7 @@ app.post('/upload/:id', (req, res, next) => {
|
||||
return;
|
||||
}
|
||||
const meta = JSON.parse(req.header('X-File-Metadata'));
|
||||
log.info('meta', meta)
|
||||
log.info('meta', meta);
|
||||
req.pipe(req.busboy);
|
||||
|
||||
req.busboy.on('file', (fieldname, file, filename) => {
|
||||
@@ -157,8 +157,6 @@ app.post('/upload/:id', (req, res, next) => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
app.get('/__lbheartbeat__', (req, res) => {
|
||||
|
||||
@@ -58,8 +58,8 @@ function metadata(id) {
|
||||
} else {
|
||||
reject(err);
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function filename(id) {
|
||||
@@ -98,8 +98,8 @@ function aad(id) {
|
||||
} else {
|
||||
reject();
|
||||
}
|
||||
})
|
||||
})
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
function localLength(id) {
|
||||
|
||||
Reference in New Issue
Block a user