We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6c74c69 commit 616f8bfCopy full SHA for 616f8bf
2 files changed
modules/helpers/Path.js
@@ -88,7 +88,8 @@ var Path = {
88
'Missing "' + paramName + '" parameter for path "' + pattern + '"'
89
);
90
91
- return URL.encode(params[paramName]);
+ // Preserve forward slashes.
92
+ return String(params[paramName]).split('/').map(URL.encode).join('/');
93
});
94
},
95
specs/Path.spec.js
@@ -144,6 +144,12 @@ describe('Path.injectParams', function () {
144
expect(Path.injectParams(pattern, { id: 'one, two' })).toEqual('comments/one%2C+two/edit');
145
146
147
+
148
+ describe('and a param has a forward slash', function () {
149
+ it('preserves the forward slash', function () {
150
+ expect(Path.injectParams(pattern, { id: 'the/id' })).toEqual('comments/the/id/edit');
151
+ });
152
153
154
155
0 commit comments