change || to ??

This commit is contained in:
2026-04-13 14:39:00 +07:00
parent fb64059193
commit 50332f2548
2 changed files with 2 additions and 2 deletions

View File

@@ -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}`;
}