-
Notifications
You must be signed in to change notification settings - Fork 27.1k
Description
I'm submitting a ...
[x] bug report
Current behavior
The Location class is removing the trailing slash, but it's just looking at the end of the string and the string might contain the query and hash values. Currently if you have a a trailing slash and a query parameter, the trailing slash is not being removed.
Expected behavior
The Location::stripTrailingSlash should take care of remove the trailing slash even if the query or hash are present.
Minimal reproduction of the problem with instructions
Given the route definition { path: '/test', pathMatch: 'full' }
This is the result:
/test => Works
/test/ => Works, rewrites browser url to /test
/test/?a=b => Error, doesn't find the route
What is the motivation / use case for changing the behavior?
It's a bug and causes routes not to work properly
-
Angular version: 2.1.2
Checked the regex in master branch and it's still the same as in 2.1.2 -
Browser: [all]
-
Language: [all]