@wireapp/api-client 22.14.0 → 22.14.1
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/lib/http/HttpClient.js
CHANGED
|
@@ -45,7 +45,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
45
45
|
};
|
|
46
46
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
47
47
|
exports.HttpClient = void 0;
|
|
48
|
-
const axios_1 =
|
|
48
|
+
const axios_1 = __importStar(require("axios"));
|
|
49
49
|
const axios_retry_1 = __importStar(require("axios-retry"));
|
|
50
50
|
const logdown_1 = __importDefault(require("logdown"));
|
|
51
51
|
const events_1 = require("events");
|
|
@@ -198,7 +198,7 @@ class HttpClient extends events_1.EventEmitter {
|
|
|
198
198
|
params: clientId && { client_id: clientId },
|
|
199
199
|
};
|
|
200
200
|
if ((expiredAccessToken === null || expiredAccessToken === void 0 ? void 0 : expiredAccessToken.access_token) && (config === null || config === void 0 ? void 0 : config.headers)) {
|
|
201
|
-
config.headers =
|
|
201
|
+
config.headers = new axios_1.AxiosHeaders(config.headers);
|
|
202
202
|
config.headers.set('Authorization', `${expiredAccessToken.token_type} ${decodeURIComponent(expiredAccessToken.access_token)}`);
|
|
203
203
|
}
|
|
204
204
|
const response = await (0, cookie_1.sendRequestWithCookie)(this, config);
|
package/lib/shims/node/cookie.js
CHANGED
|
@@ -22,6 +22,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
22
22
|
};
|
|
23
23
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
24
24
|
exports.sendRequestWithCookie = exports.retrieveCookie = void 0;
|
|
25
|
+
const axios_1 = require("axios");
|
|
25
26
|
const logdown_1 = __importDefault(require("logdown"));
|
|
26
27
|
const tough_cookie_1 = require("tough-cookie");
|
|
27
28
|
const auth_1 = require("../../auth/");
|
|
@@ -53,7 +54,7 @@ exports.retrieveCookie = retrieveCookie;
|
|
|
53
54
|
const sendRequestWithCookie = async (client, config) => {
|
|
54
55
|
const cookie = CookieStore_1.CookieStore.getCookie();
|
|
55
56
|
if (cookie && !cookie.isExpired) {
|
|
56
|
-
config.headers =
|
|
57
|
+
config.headers = new axios_1.AxiosHeaders(config.headers);
|
|
57
58
|
config.headers.set('Cookie', `zuid=${cookie.zuid}`);
|
|
58
59
|
config.withCredentials = true;
|
|
59
60
|
}
|
package/package.json
CHANGED