@tiledesk/tiledesk-tybot-connector 0.1.38 → 0.1.39
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +3 -0
- package/ExtApi.js +15 -8
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/ExtApi.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
let axios = require('axios');
|
|
2
|
+
let https = require("https");
|
|
2
3
|
|
|
3
4
|
class ExtApi {
|
|
4
5
|
|
|
@@ -109,14 +110,20 @@ class ExtApi {
|
|
|
109
110
|
console.log("API URL:", options.url);
|
|
110
111
|
console.log("** Options:", options);
|
|
111
112
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
113
|
+
let axios_options = {
|
|
114
|
+
url: options.url,
|
|
115
|
+
method: options.method,
|
|
116
|
+
data: options.json,
|
|
117
|
+
params: options.params,
|
|
118
|
+
headers: options.headers
|
|
119
|
+
}
|
|
120
|
+
if (options.url.startsWith("https:")) {
|
|
121
|
+
const httpsAgent = new https.Agent({
|
|
122
|
+
rejectUnauthorized: false,
|
|
123
|
+
});
|
|
124
|
+
axios_options.httpsAgent = httpsAgent;
|
|
125
|
+
}
|
|
126
|
+
axios(axios_options)
|
|
120
127
|
.then((res) => {
|
|
121
128
|
if (this.log) {
|
|
122
129
|
console.log("Response for url:", options.url);
|