Repository navigation
[go_router] Doesn't support "/abc", "/ABC" as two different paths #169809
Copy link
Copy link
Closed
flutter/packages
#9426Closed
Copy link
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.32Found to occur in 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33Found to occur in 3.33has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: go_routerThe go_router packageThe go_router packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-webWeb applications specificallyWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team
Description
What package does this bug report belong to?
go_router
What target platforms are you seeing this bug on?
Web
Have you already upgraded your packages?
Yes
Dependency versions
pubspec.lock
packages:
go_router:
dependency: "direct main"
description:
name: go_router
sha256: "0b1e06223bee260dee31a171fb1153e306907563a0b0225e8c1733211911429a"
url: "https://pub.dev"
source: hosted
version: "15.1.2"
Steps to reproduce
- go_router configuration:
final GoRouter _router = GoRouter(
initialLocation: '/',
routes: <RouteBase>[
GoRoute(path: '/', builder: (_, _) => Home(),),
GoRoute(path: '/abc', builder: (_, _) => Home(),),
GoRoute(path: '/ABC', builder: (_, _) => Home(),),
],
);
- Run the app.
- Open "/abc", it should work.
- Open "/ABC", throws an exception.
Expected results
The part of the URL after the domain name (the "path" or "directory" part) is generally case-sensitive on most web servers, especially those running on Unix-like operating systems, so expectation is that all three endpoints should render Home().
Actual results
"/ABC" throws
======== Exception caught by widgets library =======================================================
The following assertion was thrown building DefaultSelectionStyle:
Assertion failed: file:///C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dev/go_router-15.1.2/lib/src/match.dart:245:12
uriPathToCompare.startsWith(newMatchedLocationToCompare)
is not true
Code sample
Code sample
final GoRouter _router = GoRouter(
initialLocation: '/',
routes: <RouteBase>[
GoRoute(path: '/', builder: (_, _) => Home(),),
GoRoute(path: '/abc', builder: (_, _) => Home(),),
GoRoute(path: '/ABC', builder: (_, _) => Home(),),
],
);Screenshots or Videos
Logs
Logs
======== Exception caught by widgets library =======================================================
The following assertion was thrown building DefaultSelectionStyle:
Assertion failed: file:///C:/Users/user/AppData/Local/Pub/Cache/hosted/pub.dev/go_router-15.1.2/lib/src/match.dart:245:12
uriPathToCompare.startsWith(newMatchedLocationToCompare)
is not trueFlutter Doctor output
Doctor output
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.32.0, on Microsoft Windows [Version 10.0.22631.5189], locale en-US)
[√] Windows Version (11 Pro 64-bit, 23H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Android Studio (version 2024.3.2)
[√] IntelliJ IDEA Community Edition (version 2023.1)
[√] VS Code (version 1.100.2)
[√] Connected device (3 available)
[√] Network resourcesReactions are currently unavailable
Metadata
Metadata
Assignees
Labels
P2Important issues not at the top of the work listImportant issues not at the top of the work listfound in release: 3.32Found to occur in 3.32Found to occur in 3.32found in release: 3.33Found to occur in 3.33Found to occur in 3.33has reproducible stepsThe issue has been confirmed reproducible and is ready to work onThe issue has been confirmed reproducible and is ready to work onp: go_routerThe go_router packageThe go_router packagepackageflutter/packages repository. See also p: labels.flutter/packages repository. See also p: labels.platform-webWeb applications specificallyWeb applications specificallyr: fixedIssue is closed as already fixed in a newer versionIssue is closed as already fixed in a newer versionteam-frameworkOwned by Framework teamOwned by Framework teamtriaged-frameworkTriaged by Framework teamTriaged by Framework team

Activity
[-]Doesn't support "/abc", "/ABC" as two different paths[/-][+][go_router] Doesn't support "/abc", "/ABC" as two different paths[/+]darshankawar commentedon Jun 2, 2025
@deegoy2
I tried with below runnable code sample with which I didn't see the reported error. Please provide updated code that triggers the error. I tried with latest stable version (3.32.1).
runnable code
iapicca commentedon Jun 2, 2025
@darshankawar
try this
navigate to "lower case" and observe the error
cc @deegoy2 in case I missed something
deegoy2 commentedon Jun 2, 2025
Thank you @iapicca, your example shows the error for nested routes.
Created this to show the same error for multiple base routes.
darshankawar commentedon Jun 3, 2025
Thanks for the upated repos. Using below one, I was able to replicate the reported behavior on latest sdk versions.
runnable code
4 remaining items
[go_router_builder] Skip case sensitive test (#9444)
[go_router] Fix routing to treat URLs with different cases (e.g., `/H…
iapicca commentedon Jun 24, 2025
that was really fast <3 @ValentinVignal
[go_router_builder] Skip case sensitive test (flutter#9444)
[go_router] Fix routing to treat URLs with different cases (e.g., `/H…
github-actions commentedon Jul 9, 2025
This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of
flutter doctor -vand a minimal reproduction of the issue.[go_router] Fix routing to treat URLs with different cases (e.g., `/H…
[go_router] Fix routing to treat URLs with different cases (e.g., `/H…
[go_router] Fix routing to treat URLs with different cases (e.g., `/H…