Skip to content
This repository has been archived by the owner on Feb 25, 2022. It is now read-only.

URL ending with forward slash / should not throw an error #191

Closed
osaxma opened this issue Nov 24, 2021 · 4 comments
Closed

URL ending with forward slash / should not throw an error #191

osaxma opened this issue Nov 24, 2021 · 4 comments
Labels
bug Something isn't working fix awaiting confirmation

Comments

@osaxma
Copy link

osaxma commented Nov 24, 2021

Currently, whenever there's a forward slash at the end of the URL (e.g., /books/popular/), the following error occurs:

The following _Exception was thrown Exception during GoRouter navigation:
Exception: no routes for location: /books/popular/

I believe it'd be reasonable to treat the following two URLs as the same thing since it's a common behavior among most websites:

 /books/popular/
 /books/popular 

Simplest use case is when a user modifies the URL manually and leaves the slash up there. It'd be a bad UX if the user receive an error page for such a case.

@csells
Copy link
Owner

csells commented Nov 24, 2021

You're absolutely right. That should work. I'm take a look.

@csells csells changed the title [Proposal] URL ending with forward slash / should not throw an error URL ending with forward slash / should not throw an error Nov 24, 2021
@csells csells added the bug Something isn't working label Nov 24, 2021
@csells
Copy link
Owner

csells commented Nov 24, 2021

v2.3.1 should fix this issue. @osaxma can you please verify?

@osaxma
Copy link
Author

osaxma commented Nov 24, 2021

Thanks Chris -- it's working now 🙏🏽

@osaxma osaxma closed this as completed Nov 24, 2021
@csells
Copy link
Owner

csells commented Nov 24, 2021

Thanks for the bug reports, @osaxma. You're making go_router better.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working fix awaiting confirmation
Projects
None yet
Development

No branches or pull requests

2 participants