@checkly/playwright-core 1.54.2-beta.2 → 1.54.2-beta.3
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.
|
@@ -39,7 +39,8 @@ const dynamicallyAddedSecrets = /* @__PURE__ */ new Set();
|
|
|
39
39
|
let cachedAuthorizationHeaderSecrets = null;
|
|
40
40
|
const extractAuthorizationHeaderValue = (authorizationHeaderValue) => {
|
|
41
41
|
const spaceIndex = authorizationHeaderValue.indexOf(" ");
|
|
42
|
-
if (spaceIndex === -1)
|
|
42
|
+
if (spaceIndex === -1)
|
|
43
|
+
return authorizationHeaderValue;
|
|
43
44
|
return authorizationHeaderValue.slice(spaceIndex + 1);
|
|
44
45
|
};
|
|
45
46
|
diagnostics_channel.subscribe("http.client.request.start", (message) => {
|
|
@@ -68,7 +69,7 @@ const addSecret = (secret) => {
|
|
|
68
69
|
if (!secretValue)
|
|
69
70
|
return;
|
|
70
71
|
dynamicallyAddedSecrets.add(secretValue);
|
|
71
|
-
const escapedSecrets = Array.from(dynamicallyAddedSecrets).map((s) => {
|
|
72
|
+
const escapedSecrets = Array.from(dynamicallyAddedSecrets).sort((a, b) => b.length - a.length).map((s) => {
|
|
72
73
|
try {
|
|
73
74
|
return (0, import_escapeRegExp.default)(s);
|
|
74
75
|
} catch {
|
package/lib/client/fetch.js
CHANGED
|
@@ -45,7 +45,6 @@ var import_fileUtils = require("./fileUtils");
|
|
|
45
45
|
var import_headers = require("../utils/isomorphic/headers");
|
|
46
46
|
var import_rtti = require("../utils/isomorphic/rtti");
|
|
47
47
|
var import_fetch = require("../checkly/fetch");
|
|
48
|
-
var import_secretsFilter = require("../checkly/secretsFilter");
|
|
49
48
|
var import_timeoutSettings = require("./timeoutSettings");
|
|
50
49
|
class APIRequest {
|
|
51
50
|
constructor(playwright) {
|
|
@@ -224,10 +223,6 @@ class APIRequestContext extends import_channelOwner.ChannelOwner {
|
|
|
224
223
|
const fixtures = {
|
|
225
224
|
__testHookLookup: options.__testHookLookup
|
|
226
225
|
};
|
|
227
|
-
for (const header of headers || []) {
|
|
228
|
-
if (header.name.toLowerCase() === "authorization")
|
|
229
|
-
(0, import_secretsFilter.addSecret)(header.value);
|
|
230
|
-
}
|
|
231
226
|
const result = await this._channel.fetch({
|
|
232
227
|
url,
|
|
233
228
|
params: typeof options.params === "object" ? objectToArray(options.params) : void 0,
|
package/lib/server/fetch.js
CHANGED
|
@@ -51,6 +51,7 @@ var import_happyEyeballs = require("./utils/happyEyeballs");
|
|
|
51
51
|
var import_happyEyeballs2 = require("./utils/happyEyeballs");
|
|
52
52
|
var import_tracing = require("./trace/recorder/tracing");
|
|
53
53
|
var import_fetch = require("../checkly/fetch");
|
|
54
|
+
var import_secretsFilter = require("../checkly/secretsFilter");
|
|
54
55
|
class APIRequestContext extends import_instrumentation.SdkObject {
|
|
55
56
|
constructor(parent) {
|
|
56
57
|
super(parent, "request-context");
|
|
@@ -141,6 +142,10 @@ class APIRequestContext extends import_instrumentation.SdkObject {
|
|
|
141
142
|
const postData = serializePostData(params, headers);
|
|
142
143
|
if (postData)
|
|
143
144
|
setHeader(headers, "content-length", String(postData.byteLength));
|
|
145
|
+
for (const [headerKey, headerValue] of Object.entries(headers)) {
|
|
146
|
+
if (headerKey.toLowerCase() === "authorization")
|
|
147
|
+
(0, import_secretsFilter.addSecret)(headerValue);
|
|
148
|
+
}
|
|
144
149
|
const fetchResponse = await this._sendRequestWithRetries(progress, requestUrl, options, postData, params.maxRetries);
|
|
145
150
|
const fetchUid = this._storeResponseBody(fetchResponse.body);
|
|
146
151
|
this.fetchLog.set(fetchUid, progress.metadata.log);
|