From 6873c2ead2cb4f40003353bd6dad50e77a7356e3 Mon Sep 17 00:00:00 2001 From: Scott Anderson Date: Mon, 16 Nov 2020 11:52:56 -0700 Subject: [PATCH] updated rewrite rules for multiple forward slashes, resolves influxdata/idpe#9112 (#1834) --- deploy/edge.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/deploy/edge.js b/deploy/edge.js index d7a1b79f3..7e6253eba 100644 --- a/deploy/edge.js +++ b/deploy/edge.js @@ -77,6 +77,9 @@ exports.handler = (event, context, callback) => { '.sha256': true, }; + // Remove multiple slashes from path + permanantRedirect(/\/{2,}/.test(request.uri), request.uri.replace(/\/{2,}/, `/`)); + // Remove index.html from path permanantRedirect(request.uri.endsWith('index.html'), request.uri.substr(0, request.uri.length - indexPath.length));