condition check gallery

This commit is contained in:
jackiettran
2025-12-16 13:50:23 -05:00
parent 372ab093ef
commit 27a7b641dd
8 changed files with 421 additions and 64 deletions

View File

@@ -177,7 +177,16 @@ router.get(
requireS3Enabled,
async (req, res, next) => {
try {
const { key } = req.params;
// Express wildcard params may be string or array - handle both
let key = req.params.key;
if (Array.isArray(key)) {
key = key.join("/");
}
if (!key || typeof key !== "string") {
return res.status(400).json({ error: "Invalid key parameter" });
}
// Decode URL-encoded characters (e.g., %2F -> /)
key = decodeURIComponent(key);
// Only allow private folders to use signed URLs
const isPrivate =