fix checking file early
This commit is contained in:
parent
e4a0028f5d
commit
12ccce3016
4 changed files with 6 additions and 11 deletions
|
@ -44,13 +44,13 @@ module.exports = async function(ws, req) {
|
|||
nonce: crypto.randomBytes(16).toString('base64')
|
||||
};
|
||||
|
||||
const protocol = config.env === 'production' ? 'https' : req.protocol;
|
||||
const url = `${protocol}://${req.get('host')}/download/${newId}/`;
|
||||
|
||||
const limiter = new Limiter(config.max_file_size);
|
||||
fileStream = wsStream(ws, { binary: true }).pipe(limiter);
|
||||
storage.set(newId, fileStream, meta);
|
||||
|
||||
const protocol = config.env === 'production' ? 'https' : req.protocol;
|
||||
const url = `${protocol}://${req.get('host')}/download/${newId}/`;
|
||||
|
||||
ws.send(
|
||||
JSON.stringify({
|
||||
url,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue