Skip to content

Commit 5a6823a

Browse files
committed
Stick with %20, don't replace with +
1 parent 0790890 commit 5a6823a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

src/shared/uriTemplate.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ describe("UriTemplate", () => {
3434
it("should encode reserved characters", () => {
3535
const template = new UriTemplate("{var}");
3636
expect(template.expand({ var: "value with spaces" })).toBe(
37-
"value+with+spaces",
37+
"value%20with%20spaces",
3838
);
3939
});
4040
});

src/shared/uriTemplate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ export class UriTemplate {
125125
if (operator === "+" || operator === "#") {
126126
return encodeURI(value);
127127
}
128-
return encodeURIComponent(value).replace(/%20/g, "+");
128+
return encodeURIComponent(value);
129129
}
130130

131131
private expandPart(

0 commit comments

Comments
 (0)