mirror of
https://gitlab.com/timvisee/send.git
synced 2025-12-06 14:10:53 +03:00
Properly derive base URL as configured in file upload logic
Fixes https://github.com/timvisee/send/issues/29
This commit is contained in:
@@ -65,8 +65,7 @@ module.exports = 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 url = `${config.deriveBaseUrl(req)}/download/${newId}/`;
|
||||
|
||||
ws.send(
|
||||
JSON.stringify({
|
||||
|
||||
Reference in New Issue
Block a user