camstreamerlib 3.2.3 → 3.2.4
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.
|
@@ -30,16 +30,15 @@ class HttpRequestSender {
|
|
|
30
30
|
return this.sendRequestWithAuth(options, postData);
|
|
31
31
|
}
|
|
32
32
|
sendRequestWithAuth(options, postData, wwwAuthenticateHeader) {
|
|
33
|
-
var _a;
|
|
33
|
+
var _a, _b;
|
|
34
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
35
|
+
(_a = options.timeout) !== null && _a !== void 0 ? _a : (options.timeout = 10000);
|
|
35
36
|
const url = HttpRequestSender.getURL(options);
|
|
36
37
|
const controller = new AbortController();
|
|
37
|
-
|
|
38
|
-
setTimeout(() => controller.abort(new Error('Request timeout')), options.timeout);
|
|
39
|
-
}
|
|
38
|
+
setTimeout(() => controller.abort(new Error('Request timeout')), options.timeout);
|
|
40
39
|
const authorization = this.getAuthorization(options, wwwAuthenticateHeader);
|
|
41
40
|
if (authorization !== undefined) {
|
|
42
|
-
(
|
|
41
|
+
(_b = options.headers) !== null && _b !== void 0 ? _b : (options.headers = {});
|
|
43
42
|
options.headers['Authorization'] = authorization;
|
|
44
43
|
}
|
|
45
44
|
let res;
|