From bd268a00c484c0a2df36debd21ca9f0dc64ef693 Mon Sep 17 00:00:00 2001 From: Christian Bedon Date: Wed, 27 Sep 2023 14:22:57 -0500 Subject: [PATCH] fix: url regex and add url and img routes --- server/live-loan-router.js | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/server/live-loan-router.js b/server/live-loan-router.js index 11ca518854..44afa8cbf8 100644 --- a/server/live-loan-router.js +++ b/server/live-loan-router.js @@ -185,8 +185,22 @@ module.exports = function liveLoanRouter(cache) { }); }); + // Loan Id URL Router + router.use('/lid/:id([0-9]{0,})/url', async (req, res) => { + await tracer.trace('live-loan.loanid.redirectToUrl', { resource: req.path }, async () => { + await redirectToUrl('loanid', cache, req, res); + }); + }); + + // Loan Id IMG Router (Legacy) + router.use('/lid/:id([0-9]{0,})/img', async (req, res) => { + await tracer.trace('live-loan.loanid.serveImg', { resource: req.path }, async () => { + await serveImg('loanid', 'legacy', cache, req, res); + }); + }); + // Loan Id IMG Router (Kiva Classic) - router.use('/lid/:id([a-zA-Z0-9.%,_-]{0,})/img2', async (req, res) => { + router.use('/lid/:id([0-9]{0,})/img2', async (req, res) => { await tracer.trace('live-loan.loanid.serveImg', { resource: req.path }, async () => { await serveImg('loanid', 'classic', cache, req, res); });