From a5823effe98cb213356100a77f0fc9c91f65c405 Mon Sep 17 00:00:00 2001 From: ZGaetano Date: Tue, 19 May 2026 23:44:17 -0400 Subject: [PATCH] feat(assets): add ?redirect=1 to thumbnail endpoint for img src use --- services/mam-api/src/routes/assets.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/services/mam-api/src/routes/assets.js b/services/mam-api/src/routes/assets.js index a8c6cfd..7133758 100644 --- a/services/mam-api/src/routes/assets.js +++ b/services/mam-api/src/routes/assets.js @@ -483,7 +483,7 @@ router.get('/:id/video', async (req, res, next) => { } catch (err) { next(err); } }); -// GET /:id/thumbnail - Signed URL for thumbnail image +// GET /:id/thumbnail - Signed URL (JSON) or 302 redirect (?redirect=1) for thumbnail router.get('/:id/thumbnail', async (req, res, next) => { try { const { id } = req.params; @@ -503,6 +503,9 @@ router.get('/:id/thumbnail', async (req, res, next) => { } const url = await getSignedUrlForObject(thumbnail_s3_key); + + // ?redirect=1 lets work directly in the browser + if (req.query.redirect === '1') return res.redirect(302, url); res.json({ url }); } catch (err) { next(err);