aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/background.ts
diff options
context:
space:
mode:
Diffstat (limited to 'src/background.ts')
-rw-r--r--src/background.ts6
1 files changed, 1 insertions, 5 deletions
diff --git a/src/background.ts b/src/background.ts
index 6862bdda..70519945 100644
--- a/src/background.ts
+++ b/src/background.ts
@@ -164,11 +164,7 @@ async function asyncRequestToServer(type: string, address: string, data = {}) {
async function sendRequestToCustomServer(type: string, url: string, data = {}) {
// If GET, convert JSON to parameters
if (type.toLowerCase() === "get") {
- for (const key in data) {
- const seperator = url.includes("?") ? "&" : "?";
- const value = (typeof(data[key]) === "string") ? data[key]: JSON.stringify(data[key]);
- url += seperator + key + "=" + value;
- }
+ url = utils.objectToURI(url, data, true);
data = null;
}