Stick with %20, don't replace with +
This commit is contained in:
parent
0790890bf3
commit
5a6823a0db
2 changed files with 2 additions and 2 deletions
|
|
@ -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",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -125,7 +125,7 @@ export class UriTemplate {
|
|||
if (operator === "+" || operator === "#") {
|
||||
return encodeURI(value);
|
||||
}
|
||||
return encodeURIComponent(value).replace(/%20/g, "+");
|
||||
return encodeURIComponent(value);
|
||||
}
|
||||
|
||||
private expandPart(
|
||||
|
|
|
|||
Loading…
Reference in a new issue