Skip to content

Commit 4e2ca3c

Browse files
committed
[fixed] URI escape path components with special chars
Fixes #1025
1 parent 8b81218 commit 4e2ca3c

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

modules/__tests__/URLUtils-test.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -260,6 +260,12 @@ describe('formatPattern', function () {
260260
expect(formatPattern(pattern, { id: 'alt.black.helicopter' })).toEqual('comments/alt.black.helicopter/edit');
261261
});
262262
});
263+
264+
describe('and some params contain special characters', function () {
265+
it('returns the correct path', function () {
266+
expect(formatPattern(pattern, { id: '?not=confused&with=query#string' })).toEqual('comments/%3Fnot%3Dconfused%26with%3Dquery%23string/edit');
267+
});
268+
});
263269
});
264270

265271
describe('when a pattern has one splat', function () {

0 commit comments

Comments
 (0)