condition check gallery
This commit is contained in:
@@ -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 =
|
||||
|
||||
Reference in New Issue
Block a user