File tree Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Expand file tree Collapse file tree 2 files changed +7
-1
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ var qs = require('qs');
4
4
5
5
var paramCompileMatcher = / : ( [ a - z A - Z _ $ ] [ a - z A - Z 0 - 9 _ $ ] * ) | [ * . ( ) \[ \] \\ + | { } ^ $ ] / g;
6
6
var paramInjectMatcher = / : ( [ a - z A - Z _ $ ] [ a - z A - Z 0 - 9 _ $ ? ] * [ ? ] ? ) | [ * ] / g;
7
- var paramInjectTrailingSlashMatcher = / \/ \/ \? | \/ \? / g;
7
+ var paramInjectTrailingSlashMatcher = / \/ \/ \? | \/ \? \/ | \/ \? / g;
8
8
var queryMatcher = / \? ( .+ ) / ;
9
9
10
10
var _compiledPatterns = { } ;
Original file line number Diff line number Diff line change @@ -274,6 +274,12 @@ describe('Path.injectParams', function () {
274
274
expect ( Path . injectParams ( '/foo.bar.baz' ) ) . toEqual ( '/foo.bar.baz' ) ;
275
275
} ) ;
276
276
} ) ;
277
+
278
+ describe ( 'when a pattern has optional slashes' , function ( ) {
279
+ it ( 'returns the correct path' , function ( ) {
280
+ expect ( Path . injectParams ( '/foo/?/bar/?/baz/?' ) ) . toEqual ( '/foo/bar/baz/' ) ;
281
+ } ) ;
282
+ } ) ;
277
283
} ) ;
278
284
279
285
describe ( 'Path.extractQuery' , function ( ) {
You can’t perform that action at this time.
0 commit comments