diff --git a/templates/modern/src/helper.test.ts b/templates/modern/src/helper.test.ts index 8587bdc8dff..3e0a82f75c2 100644 --- a/templates/modern/src/helper.test.ts +++ b/templates/modern/src/helper.test.ts @@ -19,6 +19,7 @@ test('is same URL', () => { expect(isSameURL({ pathname: '/a/foo.html' }, { pathname: '/a/foo' })).toBeTruthy() expect(isSameURL({ pathname: '/a/foo/' }, { pathname: '/a/foo' })).toBeTruthy() expect(isSameURL({ pathname: '/a/foo/index.html' }, { pathname: '/a/foo' })).toBeTruthy() + expect(isSameURL({ pathname: '/a/index.html' }, { pathname: '/A/Index.html' })).toBeTruthy() expect(isSameURL({ pathname: '/a/foo/index.html' }, { pathname: '/a/bar' })).toBeFalsy() }) diff --git a/templates/modern/src/helper.ts b/templates/modern/src/helper.ts index 7600bd64ba9..d1175511e2c 100644 --- a/templates/modern/src/helper.ts +++ b/templates/modern/src/helper.ts @@ -89,5 +89,6 @@ export function isSameURL(a: { pathname: string }, b: { pathname: string }): boo .replace(/\/index\.html$/gi, '/') .replace(/\.html$/gi, '') .replace(/\/$/gi, '') + .toLowerCase() } }