@pipedream/platform
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -19,4 +19,5 @@ "use strict"; | ||
return; | ||
const url = new URL(config.url); | ||
const queryString = url.search.substr(1); | ||
const { url, baseURL, } = config; | ||
const newUrl = new URL((baseURL !== null && baseURL !== void 0 ? baseURL : "") + url); | ||
const queryString = newUrl.search.substr(1); | ||
if (queryString) { | ||
@@ -36,4 +37,4 @@ // https://stackoverflow.com/a/8649003/387413 | ||
} | ||
url.search = ""; | ||
config.url = url.toString(); // if ends with ? should be okay, but could be cleaner | ||
newUrl.search = ""; | ||
config.url = newUrl.toString(); // if ends with ? should be okay, but could be cleaner | ||
} | ||
@@ -64,5 +65,7 @@ } | ||
const { oauthSignerUri, token, } = signConfig; | ||
const { baseURL, url, } = config; | ||
const newUrl = buildURL((baseURL !== null && baseURL !== void 0 ? baseURL : "") + url, config.params, oauth1ParamsSerializer); // build url as axios will | ||
const requestData = { | ||
method: config.method || "get", | ||
url: buildURL(config.url, config.params, oauth1ParamsSerializer), | ||
url: newUrl, | ||
}; | ||
@@ -69,0 +72,0 @@ // the OAuth specification explicitly states that only form-encoded data should be included |
@@ -19,4 +19,7 @@ import axios from "axios"; | ||
if (!config.url) return; | ||
const url = new URL(config.url); | ||
const queryString = url.search.substr(1); | ||
const { | ||
url, baseURL, | ||
} = config; | ||
const newUrl = new URL((baseURL ?? "") + url); | ||
const queryString = newUrl.search.substr(1); | ||
if (queryString) { | ||
@@ -34,4 +37,4 @@ // https://stackoverflow.com/a/8649003/387413 | ||
} | ||
url.search = ""; | ||
config.url = url.toString(); // if ends with ? should be okay, but could be cleaner | ||
newUrl.search = ""; | ||
config.url = newUrl.toString(); // if ends with ? should be okay, but could be cleaner | ||
} | ||
@@ -66,5 +69,9 @@ } | ||
} = signConfig; | ||
const { | ||
baseURL, url, | ||
} = config; | ||
const newUrl: string = buildURL((baseURL ?? "") + url, config.params, oauth1ParamsSerializer); // build url as axios will | ||
const requestData = { | ||
method: config.method || "get", | ||
url: buildURL(config.url, config.params, oauth1ParamsSerializer), // build url as axios will | ||
url: newUrl, | ||
}; | ||
@@ -71,0 +78,0 @@ // the OAuth specification explicitly states that only form-encoded data should be included |
{ | ||
"name": "@pipedream/platform", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "Pipedream platform globals (typing and runtime type checking)", | ||
@@ -5,0 +5,0 @@ "homepage": "https://pipedream.com", |
32893
995