Skip to content

Commit 4b67e6f

Browse files
committed
feat: fix match for url encoded urls
1 parent d1acf18 commit 4b67e6f

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed

src/index.js

-2
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,6 @@ class Route {
130130
routeName: name,
131131
pageName: page
132132
})
133-
134-
console.log('---> NEW ROUTE', this)
135133
}
136134

137135
match (path) {

test/index.test.js

+7
Original file line numberDiff line numberDiff line change
@@ -188,6 +188,13 @@ describe(`Router ${routerMethods.join(', ')}`, () => {
188188
testMethods(['/a', {}], [href, as, {}])
189189
})
190190

191+
test('with encoded route url', () => {
192+
const {routes, testMethods} = setup('/â', 'a')
193+
const {route, query} = routes.match('/%C3%A2')
194+
const {as, href} = route.getUrls(query)
195+
testMethods(['/â', {}], [href, as, {}])
196+
})
197+
191198
test('with route not found', () => {
192199
setup('a').testMethods(['/b', {}], ['/b', '/b', {}])
193200
})

0 commit comments

Comments
 (0)