diff --git a/src/shared/uriTemplate.test.ts b/src/shared/uriTemplate.test.ts index 0e751311..7941d447 100644 --- a/src/shared/uriTemplate.test.ts +++ b/src/shared/uriTemplate.test.ts @@ -34,7 +34,7 @@ describe("UriTemplate", () => { it("should encode reserved characters", () => { const template = new UriTemplate("{var}"); expect(template.expand({ var: "value with spaces" })).toBe( - "value+with+spaces", + "value%20with%20spaces", ); }); }); diff --git a/src/shared/uriTemplate.ts b/src/shared/uriTemplate.ts index cd3f46f3..bb177325 100644 --- a/src/shared/uriTemplate.ts +++ b/src/shared/uriTemplate.ts @@ -125,7 +125,7 @@ export class UriTemplate { if (operator === "+" || operator === "#") { return encodeURI(value); } - return encodeURIComponent(value).replace(/%20/g, "+"); + return encodeURIComponent(value); } private expandPart(