File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -60,8 +60,12 @@ const matchChildren = (
6060
6161 // Can't create a regexp from the path because it might contain a
6262 // regexp character.
63- if ( segment . toLowerCase ( ) . indexOf ( consumedPath . toLowerCase ( ) ) === 0 ) {
63+ if (
64+ segment . toLowerCase ( ) . indexOf ( consumedPath . toLowerCase ( ) ) === 0
65+ ) {
6466 remainingPath = segment . slice ( consumedPath . length )
67+ } else {
68+ remainingPath = segment
6569 }
6670
6771 if ( ! strictTrailingSlash && ! child . children . length ) {
Original file line number Diff line number Diff line change @@ -775,14 +775,28 @@ describe('RouteNode', function() {
775775 allowNotFound : true ,
776776 trailingSlashMode : 'never' ,
777777 queryParamsMode : 'loose' ,
778- queryParams : { nullFormat : 'hidden' }
778+ queryParams : { nullFormat : 'hidden' }
779779 }
780780 const node = new RouteNode ( '' , '' , routes )
781781 node . matchPath ( '/foo+bar/AB1234.html' , options ) . params . should . eql ( {
782782 id : 'AB1234' ,
783783 name : 'foo+bar'
784784 } )
785785 } )
786+
787+ it ( 'should return null if there is no match' , ( ) => {
788+ const routes = [
789+ {
790+ name : 'page' ,
791+ path : '/:name<.+>'
792+ }
793+ ]
794+ const options = {
795+ allowNotFound : true
796+ }
797+ const node = new RouteNode ( '' , '' , routes )
798+ should ( node . matchPath ( '/foobar%24' , options ) ) . be . null ( )
799+ } )
786800} )
787801
788802function getRoutes ( trailingSlash ) {
You can’t perform that action at this time.
0 commit comments