Encoding query string URI parameters for REST requests - #7683.

This commit is contained in:
mike12345567 2022-09-07 17:31:15 +01:00
parent 86c8618e8f
commit 2fb96b29c9
2 changed files with 2 additions and 2 deletions

View File

@ -46,7 +46,7 @@ export function buildQueryString(obj) {
if (str !== "") {
str += "&"
}
str += `${key}=${value || ""}`
str += `${key}=${encodeURIComponent(value || "")}`
}
}
return str

View File

@ -215,7 +215,7 @@ module RestModule {
}
}
const main = `${path}?${queryString}`
const main = `${path}?${encodeURIComponent(queryString)}`
let complete = main
if (this.config.url && !main.startsWith("http")) {
complete = !this.config.url ? main : `${this.config.url}/${main}`