Merge branch 'master' of https://github.com/ajayyy/SponsorBlock into improvements

This commit is contained in:
Ajay Ramachandran
2021-07-31 01:02:41 -04:00
46 changed files with 25747 additions and 4714 deletions

View File

@@ -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;
}