updated rewrite rules for multiple forward slashes, resolves influxdata/idpe#9112 (#1834)

pull/1793/head^2
Scott Anderson 2020-11-16 11:52:56 -07:00 committed by GitHub
parent ad7f717a1d
commit 6873c2ead2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -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));