mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 14:10:53 +03:00
hook multifile to ui
This commit is contained in:
@@ -5,7 +5,7 @@ module.exports = async (req, res) => {
|
||||
const meta = await storage.metadata(req.params.id);
|
||||
res.set('WWW-Authenticate', `send-v1 ${meta.nonce}`);
|
||||
res.send({
|
||||
password: meta.pwd
|
||||
requiresPassword: meta.pwd
|
||||
});
|
||||
} catch (e) {
|
||||
res.sendStatus(404);
|
||||
|
||||
@@ -49,7 +49,7 @@ module.exports = function(app) {
|
||||
next();
|
||||
});
|
||||
app.use(express.json());
|
||||
app.get('/', language, pages.index);
|
||||
app.get('/', language, pages.blank);
|
||||
app.get('/legal', language, pages.legal);
|
||||
app.get('/jsconfig.js', require('./jsconfig'));
|
||||
app.get(`/share/:id${ID_REGEX}`, language, pages.blank);
|
||||
|
||||
@@ -19,16 +19,15 @@ module.exports = {
|
||||
|
||||
download: async function(req, res, next) {
|
||||
const id = req.params.id;
|
||||
|
||||
try {
|
||||
const { nonce, pwd } = await storage.metadata(id);
|
||||
res.set('WWW-Authenticate', `send-v1 ${nonce}`);
|
||||
res.send(
|
||||
stripEvents(
|
||||
routes.toString(
|
||||
`/download/${req.params.id}`,
|
||||
`/download/${id}`,
|
||||
Object.assign(state(req), {
|
||||
fileInfo: { nonce, requiresPassword: +pwd }
|
||||
fileInfo: { nonce, requiresPassword: pwd }
|
||||
})
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user