@naturalcycles/nodejs-lib 12.70.1 → 12.71.0
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/dist/got/getGot.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getGot = void 0;
|
|
4
|
+
const url_1 = require("url");
|
|
4
5
|
const js_lib_1 = require("@naturalcycles/js-lib");
|
|
5
6
|
const got_1 = require("got");
|
|
6
7
|
const __1 = require("..");
|
|
@@ -180,7 +181,9 @@ function gotBeforeRetryHook(opt) {
|
|
|
180
181
|
const statusCode = err?.response?.statusCode || 0;
|
|
181
182
|
if (statusCode && statusCode < 300) {
|
|
182
183
|
// todo: possibly remove the log message completely in the future
|
|
183
|
-
opt.logger
|
|
184
|
+
// opt.logger!.log(
|
|
185
|
+
// `skipping got.beforeRetry hook as statusCode is ${statusCode}, err.msg is ${err?.message}`,
|
|
186
|
+
// )
|
|
184
187
|
return;
|
|
185
188
|
}
|
|
186
189
|
const { method, url, prefixUrl } = options;
|
|
@@ -242,6 +245,10 @@ function gotAfterResponseHook(opt = {}) {
|
|
|
242
245
|
};
|
|
243
246
|
}
|
|
244
247
|
function getShortUrl(opt, url, prefixUrl) {
|
|
248
|
+
if (url.password) {
|
|
249
|
+
url = new url_1.URL(url.toString()); // prevent original url mutation
|
|
250
|
+
url.password = '[redacted]';
|
|
251
|
+
}
|
|
245
252
|
let shortUrl = url.toString();
|
|
246
253
|
if (opt.logWithSearchParams === false) {
|
|
247
254
|
shortUrl = shortUrl.split('?')[0];
|
package/dist/util/zip.util.d.ts
CHANGED
package/package.json
CHANGED
package/src/got/getGot.ts
CHANGED
|
@@ -207,9 +207,9 @@ function gotBeforeRetryHook(opt: GetGotOptions): BeforeRetryHook {
|
|
|
207
207
|
|
|
208
208
|
if (statusCode && statusCode < 300) {
|
|
209
209
|
// todo: possibly remove the log message completely in the future
|
|
210
|
-
opt.logger!.log(
|
|
211
|
-
|
|
212
|
-
)
|
|
210
|
+
// opt.logger!.log(
|
|
211
|
+
// `skipping got.beforeRetry hook as statusCode is ${statusCode}, err.msg is ${err?.message}`,
|
|
212
|
+
// )
|
|
213
213
|
return
|
|
214
214
|
}
|
|
215
215
|
|
|
@@ -284,6 +284,11 @@ function gotAfterResponseHook(opt: GetGotOptions = {}): AfterResponseHook {
|
|
|
284
284
|
}
|
|
285
285
|
|
|
286
286
|
function getShortUrl(opt: GetGotOptions, url: URL, prefixUrl?: string): string {
|
|
287
|
+
if (url.password) {
|
|
288
|
+
url = new URL(url.toString()) // prevent original url mutation
|
|
289
|
+
url.password = '[redacted]'
|
|
290
|
+
}
|
|
291
|
+
|
|
287
292
|
let shortUrl = url.toString()
|
|
288
293
|
|
|
289
294
|
if (opt.logWithSearchParams === false) {
|