Skip to content

Commit 0761eb6

Browse files
authored
fix: Change same URL check logic to case invariant (#9883)
fix: change url check logic to case invariant
1 parent 81790ce commit 0761eb6

File tree

2 files changed

+2
-0
lines changed

2 files changed

+2
-0
lines changed

templates/modern/src/helper.test.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ test('is same URL', () => {
1919
expect(isSameURL({ pathname: '/a/foo.html' }, { pathname: '/a/foo' })).toBeTruthy()
2020
expect(isSameURL({ pathname: '/a/foo/' }, { pathname: '/a/foo' })).toBeTruthy()
2121
expect(isSameURL({ pathname: '/a/foo/index.html' }, { pathname: '/a/foo' })).toBeTruthy()
22+
expect(isSameURL({ pathname: '/a/index.html' }, { pathname: '/A/Index.html' })).toBeTruthy()
2223

2324
expect(isSameURL({ pathname: '/a/foo/index.html' }, { pathname: '/a/bar' })).toBeFalsy()
2425
})

templates/modern/src/helper.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,5 +89,6 @@ export function isSameURL(a: { pathname: string }, b: { pathname: string }): boo
8989
.replace(/\/index\.html$/gi, '/')
9090
.replace(/\.html$/gi, '')
9191
.replace(/\/$/gi, '')
92+
.toLowerCase()
9293
}
9394
}

0 commit comments

Comments
 (0)