forked from UKSOURCE/cms.hailearning.edu.vn
change || to ??
This commit is contained in:
@@ -189,7 +189,7 @@ exports.destroy = async (req, res) => {
|
||||
|
||||
function buildSecureUrl(req, filename) {
|
||||
if (!filename) return undefined;
|
||||
const baseUrl = `${req.protocol}://${req.get('host')}`;
|
||||
const baseUrl = process.env.BACKEND_URL ?? `${req.protocol}://${req.get('host')}`;
|
||||
const name = path.basename(filename);
|
||||
return `${baseUrl}/secure-files/${name}?api_key=${req.query.api_key}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user