Skip to content

Commit 26400c1

Browse files
committed
[fixed] Use encodeURI for splat params
See #1128 (comment)
1 parent 178efc3 commit 26400c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

modules/URLUtils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -177,7 +177,7 @@ export function formatPattern(pattern, params) {
177177
);
178178

179179
if (paramValue != null)
180-
pathname += encodeURIComponent(paramValue);
180+
pathname += encodeURI(paramValue);
181181
} else if (token === '(') {
182182
parenCount += 1;
183183
} else if (token === ')') {

modules/__tests__/URLUtils-test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ describe('formatPattern', function () {
264264

265265
describe('when a pattern has one splat', function () {
266266
it('returns the correct path', function () {
267-
expect(formatPattern('/a/*/d', { splat: 'b/c' })).toEqual('/a/b%2Fc/d');
267+
expect(formatPattern('/a/*/d', { splat: 'b/c' })).toEqual('/a/b/c/d');
268268
});
269269
});
270270

0 commit comments

Comments
 (0)