From 3cf03cf1dc540de80cba9e5b5b74ab9dddf62ecc Mon Sep 17 00:00:00 2001 From: Dewansh Date: Thu, 29 Aug 2024 17:00:55 +0530 Subject: [PATCH] fix: add regex check in nextjs redirection (#1858) Co-authored-by: Fionna Chan <13184582+fionnachan@users.noreply.github.com> --- packages/arb-token-bridge-ui/next.config.js | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/packages/arb-token-bridge-ui/next.config.js b/packages/arb-token-bridge-ui/next.config.js index f12c1d8a9b..957dae6ba5 100644 --- a/packages/arb-token-bridge-ui/next.config.js +++ b/packages/arb-token-bridge-ui/next.config.js @@ -28,7 +28,18 @@ module.exports = { async redirects() { return [ { - source: '/:slug', + source: '/:slug((?!^$|api/|_next/|public/)(?!.*\\.[^/]+$).+)', + missing: [ + { + type: 'query', + key: 'destinationChain' + }, + { + type: 'header', + key: 'accept', + value: 'image/.*' + } + ], destination: '/?destinationChain=:slug', permanent: true }