Skip to content

Commit

Permalink
Fix pathFromUrl method with trailing hash.
Browse files Browse the repository at this point in the history
  • Loading branch information
edoardocavazza committed Dec 19, 2023
1 parent 05726c2 commit 85d6986
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/sixty-rockets-hide.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@chialab/synapse": patch
---

Fix `pathFromUrl` method with trailing hash.
2 changes: 1 addition & 1 deletion src/Router/Router.ts
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ export class Router extends Emitter<{
return null;
}

const pathname = `/${trimSlashStart(url.pathname)}${url.search}${url.hash}`;
const pathname = `/${trimSlashStart(url.pathname)}${url.search}${url.hash || (url.href.endsWith('#') ? '#' : '')}`;
if (pathname !== this.base && pathname.indexOf(this.base) !== 0) {
return null;
}
Expand Down

0 comments on commit 85d6986

Please sign in to comment.