Add override for redirects (#16526)

This commit is contained in:
Craig Box 2025-07-16 12:06:37 +12:00 committed by GitHub
parent febc106d39
commit 8ac9f1524f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -2,6 +2,10 @@ export default async (request: Request, context) => {
const url = new URL(request.url);
let pathname = url.pathname;
if (url.searchParams.get('redirect') === 'false') {
return context.next();
}
// Normalize consecutive slashes
pathname = pathname.replace(/\/\/+/g, '/');