Skip to content

Commit 15536b8

Browse files
committed
revert encoding path params
1 parent 007aa1b commit 15536b8

File tree

2 files changed

+1
-8
lines changed

2 files changed

+1
-8
lines changed

src/static/templateUrl.test.ts

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,12 +48,6 @@ it.each([
4848
{pathParams: {baseParam: 'short', sub: 'one', sub2: 'two'}},
4949
'http://short.example.com/one/two',
5050
],
51-
[
52-
'/categories/{id}',
53-
'http://example.com',
54-
{pathParams: {id: 'womens;,%$^@$(!3'}},
55-
'http://example.com/categories/womens%253B%252C%2525%2524%255E%2540%2524(!3',
56-
],
5751
])('combines %s, %s and %s into %s', (url, base, parameters, expected) => {
5852
expect(new TemplateURL(url, base, parameters).toString()).toBe(expected);
5953
});

src/static/templateUrl.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,8 +89,7 @@ export default class TemplateURL extends URL {
8989
return parameters
9090
? template.replace(
9191
/\{([^\}]+)\}/g /* eslint-disable-line no-useless-escape */,
92-
(match, param: string) =>
93-
String(encodeURIComponent(encodeURIComponent(parameters[param])))
92+
(match, param: string) => String(parameters[param])
9493
)
9594
: template;
9695
}

0 commit comments

Comments
 (0)