mirror of
https://iceshrimp.dev/crimekillz/iceshrimp-161sh.git
synced 2024-11-23 04:33:50 +01:00
fix(nirax): Normalize path (#8877)
This commit is contained in:
parent
161289dcd7
commit
7ebb1ca5be
@ -35,7 +35,7 @@ function parsePath(path: string): ParsedPath {
|
|||||||
wildcard,
|
wildcard,
|
||||||
optional,
|
optional,
|
||||||
});
|
});
|
||||||
} else {
|
} else if (part.length !== 0) {
|
||||||
res.push(part);
|
res.push(part);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -85,9 +85,11 @@ export class Router extends EventEmitter<{
|
|||||||
|
|
||||||
if (_DEV_) console.log('Routing: ', path, queryString);
|
if (_DEV_) console.log('Routing: ', path, queryString);
|
||||||
|
|
||||||
|
const _parts = path.split('/').filter(part => part.length !== 0);
|
||||||
|
|
||||||
forEachRouteLoop:
|
forEachRouteLoop:
|
||||||
for (const route of this.routes) {
|
for (const route of this.routes) {
|
||||||
let parts = path.split('/');
|
let parts = [ ..._parts ];
|
||||||
const props = new Map<string, string>();
|
const props = new Map<string, string>();
|
||||||
|
|
||||||
pathMatchLoop:
|
pathMatchLoop:
|
||||||
|
Loading…
Reference in New Issue
Block a user