@zimic/interceptor 0.14.0 → 0.15.0-canary.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/README.md +7 -8
- package/dist/{chunk-FEGMEAEO.mjs → chunk-3O3YPVEG.mjs} +69 -104
- package/dist/chunk-3O3YPVEG.mjs.map +1 -0
- package/dist/{chunk-3623PRKE.js → chunk-CWBDZYUG.js} +69 -104
- package/dist/chunk-CWBDZYUG.js.map +1 -0
- package/dist/cli.js +7 -7
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +3 -3
- package/dist/cli.mjs.map +1 -1
- package/dist/http.d.ts +47 -38
- package/dist/http.js +173 -235
- package/dist/http.js.map +1 -1
- package/dist/http.mjs +173 -235
- package/dist/http.mjs.map +1 -1
- package/dist/server.d.ts +15 -10
- package/dist/server.js +5 -5
- package/dist/server.mjs +1 -1
- package/package.json +3 -3
- package/src/cli/server/start.ts +1 -1
- package/src/http/index.ts +14 -1
- package/src/http/interceptor/HttpInterceptorClient.ts +23 -34
- package/src/http/interceptor/HttpInterceptorStore.ts +2 -2
- package/src/http/interceptor/LocalHttpInterceptor.ts +22 -25
- package/src/http/interceptor/RemoteHttpInterceptor.ts +22 -25
- package/src/http/interceptor/errors/NotStartedHttpInterceptorError.ts +1 -1
- package/src/http/interceptor/errors/UnknownHttpInterceptorPlatformError.ts +1 -1
- package/src/http/interceptor/types/options.ts +3 -3
- package/src/http/interceptor/types/public.ts +12 -9
- package/src/http/interceptorWorker/HttpInterceptorWorker.ts +10 -28
- package/src/http/interceptorWorker/LocalHttpInterceptorWorker.ts +21 -25
- package/src/http/interceptorWorker/RemoteHttpInterceptorWorker.ts +22 -26
- package/src/http/requestHandler/HttpRequestHandlerClient.ts +13 -23
- package/src/http/requestHandler/LocalHttpRequestHandler.ts +17 -21
- package/src/http/requestHandler/RemoteHttpRequestHandler.ts +19 -29
- package/src/http/requestHandler/types/public.ts +23 -23
- package/src/http/requestHandler/types/requests.ts +1 -1
- package/src/server/InterceptorServer.ts +45 -68
- package/src/server/types/public.ts +15 -10
- package/src/webSocket/WebSocketClient.ts +1 -1
- package/src/webSocket/WebSocketHandler.ts +11 -19
- package/src/webSocket/WebSocketServer.ts +4 -4
- package/dist/chunk-3623PRKE.js.map +0 -1
- package/dist/chunk-FEGMEAEO.mjs.map +0 -1
package/README.md
CHANGED
|
@@ -149,7 +149,7 @@ Check our [getting started guide](https://github.com/zimicjs/zimic/wiki/getting
|
|
|
149
149
|
const interceptor = httpInterceptor.create<Schema>({
|
|
150
150
|
type: 'local',
|
|
151
151
|
baseURL: 'http://localhost:3000',
|
|
152
|
-
saveRequests: true, // Allow access to `handler.requests
|
|
152
|
+
saveRequests: true, // Allow access to `handler.requests`
|
|
153
153
|
});
|
|
154
154
|
```
|
|
155
155
|
|
|
@@ -227,21 +227,20 @@ Check our [getting started guide](https://github.com/zimicjs/zimic/wiki/getting
|
|
|
227
227
|
test('example', async () => {
|
|
228
228
|
// Your application makes requests...
|
|
229
229
|
|
|
230
|
-
|
|
231
|
-
expect(requests).toHaveLength(1);
|
|
230
|
+
expect(handler.requests).toHaveLength(1);
|
|
232
231
|
|
|
233
|
-
expect(requests[0].headers.get('authorization')).toBe('Bearer my-token');
|
|
232
|
+
expect(handler.requests[0].headers.get('authorization')).toBe('Bearer my-token');
|
|
234
233
|
|
|
235
|
-
expect(requests[0].searchParams.size).toBe(1);
|
|
236
|
-
expect(requests[0].searchParams.get('username')).toBe('my');
|
|
234
|
+
expect(handler.requests[0].searchParams.size).toBe(1);
|
|
235
|
+
expect(handler.requests[0].searchParams.get('username')).toBe('my');
|
|
237
236
|
|
|
238
|
-
expect(requests[0].body).toBe(null);
|
|
237
|
+
expect(handler.requests[0].body).toBe(null);
|
|
239
238
|
});
|
|
240
239
|
```
|
|
241
240
|
|
|
242
241
|
> [!NOTE]
|
|
243
242
|
>
|
|
244
|
-
>
|
|
243
|
+
> Step 5.2 manually verifies the requests made by the application. This is optional in this example because the
|
|
245
244
|
> [`with`](https://github.com/zimicjs/zimic/wiki/api‐zimic‐interceptor‐http#http-handlerwithrestriction) and
|
|
246
245
|
> [`times`](https://github.com/zimicjs/zimic/wiki/api‐zimic‐interceptor‐http#http-handlertimes) calls (step 5.1) already
|
|
247
246
|
> act as a declarative validation, expressing that exactly one request is expected with specific data. If fewer or more
|
|
@@ -273,26 +273,14 @@ var HttpInterceptorWorker = class _HttpInterceptorWorker {
|
|
|
273
273
|
static {
|
|
274
274
|
__name(this, "HttpInterceptorWorker");
|
|
275
275
|
}
|
|
276
|
-
|
|
277
|
-
|
|
276
|
+
platform = null;
|
|
277
|
+
isRunning = false;
|
|
278
278
|
startingPromise;
|
|
279
279
|
stoppingPromise;
|
|
280
280
|
store = new HttpInterceptorWorkerStore_default();
|
|
281
281
|
runningInterceptors = [];
|
|
282
|
-
platform() {
|
|
283
|
-
return this._platform;
|
|
284
|
-
}
|
|
285
|
-
setPlatform(platform) {
|
|
286
|
-
this._platform = platform;
|
|
287
|
-
}
|
|
288
|
-
isRunning() {
|
|
289
|
-
return this._isRunning;
|
|
290
|
-
}
|
|
291
|
-
setIsRunning(isRunning) {
|
|
292
|
-
this._isRunning = isRunning;
|
|
293
|
-
}
|
|
294
282
|
async sharedStart(internalStart) {
|
|
295
|
-
if (this.isRunning
|
|
283
|
+
if (this.isRunning) {
|
|
296
284
|
return;
|
|
297
285
|
}
|
|
298
286
|
if (this.startingPromise) {
|
|
@@ -311,7 +299,7 @@ var HttpInterceptorWorker = class _HttpInterceptorWorker {
|
|
|
311
299
|
}
|
|
312
300
|
}
|
|
313
301
|
async sharedStop(internalStop) {
|
|
314
|
-
if (!this.isRunning
|
|
302
|
+
if (!this.isRunning) {
|
|
315
303
|
return;
|
|
316
304
|
}
|
|
317
305
|
if (this.stoppingPromise) {
|
|
@@ -376,8 +364,7 @@ var HttpInterceptorWorker = class _HttpInterceptorWorker {
|
|
|
376
364
|
}
|
|
377
365
|
findInterceptorByRequestBaseURL(request) {
|
|
378
366
|
const interceptor = this.runningInterceptors.findLast((interceptor2) => {
|
|
379
|
-
|
|
380
|
-
return request.url.startsWith(baseURL);
|
|
367
|
+
return request.url.startsWith(interceptor2.baseURLAsString);
|
|
381
368
|
});
|
|
382
369
|
return interceptor;
|
|
383
370
|
}
|
|
@@ -393,12 +380,11 @@ var HttpInterceptorWorker = class _HttpInterceptorWorker {
|
|
|
393
380
|
return defaultStrategyOrFactory;
|
|
394
381
|
}
|
|
395
382
|
async getInterceptorUnhandledRequestStrategy(request, interceptor) {
|
|
396
|
-
|
|
397
|
-
if (typeof interceptorStrategyOrFactory === "function") {
|
|
383
|
+
if (typeof interceptor.onUnhandledRequest === "function") {
|
|
398
384
|
const parsedRequest = await _HttpInterceptorWorker.parseRawUnhandledRequest(request);
|
|
399
|
-
return
|
|
385
|
+
return interceptor.onUnhandledRequest(parsedRequest);
|
|
400
386
|
}
|
|
401
|
-
return
|
|
387
|
+
return interceptor.onUnhandledRequest;
|
|
402
388
|
}
|
|
403
389
|
static createResponseFromDeclaration(request, declaration) {
|
|
404
390
|
const headers = new HttpHeaders(declaration.headers);
|
|
@@ -838,24 +824,18 @@ var WebSocketHandler = class {
|
|
|
838
824
|
__name(this, "WebSocketHandler");
|
|
839
825
|
}
|
|
840
826
|
sockets = /* @__PURE__ */ new Set();
|
|
841
|
-
|
|
842
|
-
|
|
827
|
+
socketTimeout;
|
|
828
|
+
messageTimeout;
|
|
843
829
|
channelListeners = {};
|
|
844
830
|
socketListeners = {
|
|
845
831
|
messageAbort: /* @__PURE__ */ new Map()
|
|
846
832
|
};
|
|
847
833
|
constructor(options) {
|
|
848
|
-
this.
|
|
849
|
-
this.
|
|
850
|
-
}
|
|
851
|
-
socketTimeout() {
|
|
852
|
-
return this._socketTimeout;
|
|
853
|
-
}
|
|
854
|
-
messageTimeout() {
|
|
855
|
-
return this._messageTimeout;
|
|
834
|
+
this.socketTimeout = options.socketTimeout ?? DEFAULT_WEB_SOCKET_LIFECYCLE_TIMEOUT;
|
|
835
|
+
this.messageTimeout = options.messageTimeout ?? DEFAULT_WEB_SOCKET_MESSAGE_TIMEOUT;
|
|
856
836
|
}
|
|
857
837
|
async registerSocket(socket) {
|
|
858
|
-
const openPromise = waitForOpenClientSocket(socket, { timeout: this.
|
|
838
|
+
const openPromise = waitForOpenClientSocket(socket, { timeout: this.socketTimeout });
|
|
859
839
|
const handleSocketMessage = /* @__PURE__ */ __name(async (rawMessage) => {
|
|
860
840
|
await this.handleSocketMessage(socket, rawMessage);
|
|
861
841
|
}, "handleSocketMessage");
|
|
@@ -942,7 +922,7 @@ var WebSocketHandler = class {
|
|
|
942
922
|
}
|
|
943
923
|
async closeClientSockets(sockets = this.sockets) {
|
|
944
924
|
const closingPromises = Array.from(sockets, async (socket) => {
|
|
945
|
-
await closeClientSocket(socket, { timeout: this.
|
|
925
|
+
await closeClientSocket(socket, { timeout: this.socketTimeout });
|
|
946
926
|
});
|
|
947
927
|
await Promise.all(closingPromises);
|
|
948
928
|
}
|
|
@@ -974,9 +954,9 @@ var WebSocketHandler = class {
|
|
|
974
954
|
const replyTimeout = setTimeout(() => {
|
|
975
955
|
this.offReply(channel, replyListener);
|
|
976
956
|
this.offAbortSocketMessages(sockets, abortListener);
|
|
977
|
-
const timeoutError = new WebSocketMessageTimeoutError(this.
|
|
957
|
+
const timeoutError = new WebSocketMessageTimeoutError(this.messageTimeout);
|
|
978
958
|
reject(timeoutError);
|
|
979
|
-
}, this.
|
|
959
|
+
}, this.messageTimeout);
|
|
980
960
|
const abortListener = this.onAbortSocketMessages(sockets, (error) => {
|
|
981
961
|
clearTimeout(replyTimeout);
|
|
982
962
|
this.offReply(channel, replyListener);
|
|
@@ -998,7 +978,7 @@ var WebSocketHandler = class {
|
|
|
998
978
|
}
|
|
999
979
|
async reply(request, replyData, options) {
|
|
1000
980
|
const reply = await this.createReplyMessage(request, replyData);
|
|
1001
|
-
if (this.isRunning
|
|
981
|
+
if (this.isRunning) {
|
|
1002
982
|
this.sendMessage(reply, options.sockets);
|
|
1003
983
|
}
|
|
1004
984
|
}
|
|
@@ -1013,7 +993,7 @@ var WebSocketHandler = class {
|
|
|
1013
993
|
return replyMessage;
|
|
1014
994
|
}
|
|
1015
995
|
sendMessage(message, sockets = this.sockets) {
|
|
1016
|
-
if (!this.isRunning
|
|
996
|
+
if (!this.isRunning) {
|
|
1017
997
|
throw new NotStartedWebSocketHandlerError_default();
|
|
1018
998
|
}
|
|
1019
999
|
const stringifiedMessage = JSON.stringify(message);
|
|
@@ -1093,11 +1073,11 @@ var WebSocketServer = class extends WebSocketHandler_default {
|
|
|
1093
1073
|
});
|
|
1094
1074
|
this.httpServer = options.httpServer;
|
|
1095
1075
|
}
|
|
1096
|
-
isRunning() {
|
|
1076
|
+
get isRunning() {
|
|
1097
1077
|
return this.webSocketServer !== void 0;
|
|
1098
1078
|
}
|
|
1099
1079
|
start() {
|
|
1100
|
-
if (this.isRunning
|
|
1080
|
+
if (this.isRunning) {
|
|
1101
1081
|
return;
|
|
1102
1082
|
}
|
|
1103
1083
|
const webSocketServer = new ServerSocket({ server: this.httpServer });
|
|
@@ -1114,13 +1094,13 @@ var WebSocketServer = class extends WebSocketHandler_default {
|
|
|
1114
1094
|
this.webSocketServer = webSocketServer;
|
|
1115
1095
|
}
|
|
1116
1096
|
async stop() {
|
|
1117
|
-
if (!this.webSocketServer || !this.isRunning
|
|
1097
|
+
if (!this.webSocketServer || !this.isRunning) {
|
|
1118
1098
|
return;
|
|
1119
1099
|
}
|
|
1120
1100
|
super.removeAllChannelListeners();
|
|
1121
1101
|
super.abortSocketMessages();
|
|
1122
1102
|
await super.closeClientSockets();
|
|
1123
|
-
await closeServerSocket(this.webSocketServer, { timeout: this.socketTimeout
|
|
1103
|
+
await closeServerSocket(this.webSocketServer, { timeout: this.socketTimeout });
|
|
1124
1104
|
this.webSocketServer.removeAllListeners();
|
|
1125
1105
|
this.webSocketServer = void 0;
|
|
1126
1106
|
}
|
|
@@ -1182,11 +1162,11 @@ var InterceptorServer = class {
|
|
|
1182
1162
|
static {
|
|
1183
1163
|
__name(this, "InterceptorServer");
|
|
1184
1164
|
}
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1165
|
+
httpServer;
|
|
1166
|
+
webSocketServer;
|
|
1167
|
+
hostname;
|
|
1168
|
+
port;
|
|
1169
|
+
logUnhandledRequests;
|
|
1190
1170
|
httpHandlerGroups = {
|
|
1191
1171
|
GET: [],
|
|
1192
1172
|
POST: [],
|
|
@@ -1198,68 +1178,57 @@ var InterceptorServer = class {
|
|
|
1198
1178
|
};
|
|
1199
1179
|
knownWorkerSockets = /* @__PURE__ */ new Set();
|
|
1200
1180
|
constructor(options) {
|
|
1201
|
-
this.
|
|
1202
|
-
this.
|
|
1203
|
-
this.
|
|
1204
|
-
}
|
|
1205
|
-
hostname() {
|
|
1206
|
-
return this._hostname;
|
|
1207
|
-
}
|
|
1208
|
-
port() {
|
|
1209
|
-
return this._port;
|
|
1210
|
-
}
|
|
1211
|
-
logUnhandledRequests() {
|
|
1212
|
-
return this._logUnhandledRequests;
|
|
1181
|
+
this.hostname = options.hostname ?? "localhost";
|
|
1182
|
+
this.port = options.port;
|
|
1183
|
+
this.logUnhandledRequests = options.logUnhandledRequests ?? DEFAULT_LOG_UNHANDLED_REQUESTS;
|
|
1213
1184
|
}
|
|
1214
|
-
httpURL() {
|
|
1215
|
-
if (this.
|
|
1185
|
+
get httpURL() {
|
|
1186
|
+
if (this.port === void 0) {
|
|
1216
1187
|
return void 0;
|
|
1217
1188
|
}
|
|
1218
|
-
return `http://${this.
|
|
1189
|
+
return `http://${this.hostname}:${this.port}`;
|
|
1219
1190
|
}
|
|
1220
|
-
isRunning() {
|
|
1221
|
-
return !!this.
|
|
1191
|
+
get isRunning() {
|
|
1192
|
+
return !!this.httpServer?.listening && !!this.webSocketServer?.isRunning;
|
|
1222
1193
|
}
|
|
1223
|
-
|
|
1224
|
-
if (!this.
|
|
1194
|
+
get httpServerOrThrow() {
|
|
1195
|
+
if (!this.httpServer) {
|
|
1225
1196
|
throw new NotStartedInterceptorServerError_default();
|
|
1226
1197
|
}
|
|
1227
|
-
return this.
|
|
1198
|
+
return this.httpServer;
|
|
1228
1199
|
}
|
|
1229
|
-
|
|
1230
|
-
if (!this.
|
|
1200
|
+
get webSocketServerOrThrow() {
|
|
1201
|
+
if (!this.webSocketServer) {
|
|
1231
1202
|
throw new NotStartedInterceptorServerError_default();
|
|
1232
1203
|
}
|
|
1233
|
-
return this.
|
|
1204
|
+
return this.webSocketServer;
|
|
1234
1205
|
}
|
|
1235
1206
|
async start() {
|
|
1236
|
-
if (this.isRunning
|
|
1207
|
+
if (this.isRunning) {
|
|
1237
1208
|
return;
|
|
1238
1209
|
}
|
|
1239
|
-
this.
|
|
1210
|
+
this.httpServer = createServer({
|
|
1240
1211
|
keepAlive: true,
|
|
1241
1212
|
joinDuplicateHeaders: true
|
|
1242
1213
|
});
|
|
1243
1214
|
await this.startHttpServer();
|
|
1244
|
-
this.
|
|
1245
|
-
httpServer: this.
|
|
1215
|
+
this.webSocketServer = new WebSocketServer_default({
|
|
1216
|
+
httpServer: this.httpServer
|
|
1246
1217
|
});
|
|
1247
1218
|
this.startWebSocketServer();
|
|
1248
1219
|
}
|
|
1249
1220
|
async startHttpServer() {
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
port: this._port
|
|
1221
|
+
await startHttpServer(this.httpServerOrThrow, {
|
|
1222
|
+
hostname: this.hostname,
|
|
1223
|
+
port: this.port
|
|
1254
1224
|
});
|
|
1255
|
-
this.
|
|
1256
|
-
|
|
1225
|
+
this.port = getHttpServerPort(this.httpServerOrThrow);
|
|
1226
|
+
this.httpServerOrThrow.on("request", this.handleHttpRequest);
|
|
1257
1227
|
}
|
|
1258
1228
|
startWebSocketServer() {
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
|
|
1262
|
-
webSocketServer.onEvent("interceptors/workers/use/reset", this.resetWorker);
|
|
1229
|
+
this.webSocketServerOrThrow.start();
|
|
1230
|
+
this.webSocketServerOrThrow.onEvent("interceptors/workers/use/commit", this.commitWorker);
|
|
1231
|
+
this.webSocketServerOrThrow.onEvent("interceptors/workers/use/reset", this.resetWorker);
|
|
1263
1232
|
}
|
|
1264
1233
|
commitWorker = /* @__PURE__ */ __name((message, socket) => {
|
|
1265
1234
|
const commit = message.data;
|
|
@@ -1272,7 +1241,7 @@ var InterceptorServer = class {
|
|
|
1272
1241
|
const handlersToResetTo = message.data;
|
|
1273
1242
|
const isWorkerNoLongerCommitted = handlersToResetTo === void 0;
|
|
1274
1243
|
if (isWorkerNoLongerCommitted) {
|
|
1275
|
-
this.
|
|
1244
|
+
this.webSocketServerOrThrow.abortSocketMessages([socket]);
|
|
1276
1245
|
} else {
|
|
1277
1246
|
for (const handler of handlersToResetTo) {
|
|
1278
1247
|
this.registerHttpHandler(handler, socket);
|
|
@@ -1310,25 +1279,23 @@ var InterceptorServer = class {
|
|
|
1310
1279
|
removeArrayIndex(handlerGroups, socketIndex);
|
|
1311
1280
|
}
|
|
1312
1281
|
}
|
|
1313
|
-
|
|
1314
|
-
if (!this.isRunning
|
|
1282
|
+
async stop() {
|
|
1283
|
+
if (!this.isRunning) {
|
|
1315
1284
|
return;
|
|
1316
1285
|
}
|
|
1317
1286
|
await this.stopWebSocketServer();
|
|
1318
1287
|
await this.stopHttpServer();
|
|
1319
|
-
}
|
|
1288
|
+
}
|
|
1320
1289
|
async stopHttpServer() {
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
httpServer
|
|
1324
|
-
this._httpServer = void 0;
|
|
1290
|
+
await stopHttpServer(this.httpServerOrThrow);
|
|
1291
|
+
this.httpServerOrThrow.removeAllListeners();
|
|
1292
|
+
this.httpServer = void 0;
|
|
1325
1293
|
}
|
|
1326
1294
|
async stopWebSocketServer() {
|
|
1327
|
-
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
this._webSocketServer = void 0;
|
|
1295
|
+
this.webSocketServerOrThrow.offEvent("interceptors/workers/use/commit", this.commitWorker);
|
|
1296
|
+
this.webSocketServerOrThrow.offEvent("interceptors/workers/use/reset", this.resetWorker);
|
|
1297
|
+
await this.webSocketServerOrThrow.stop();
|
|
1298
|
+
this.webSocketServer = void 0;
|
|
1332
1299
|
}
|
|
1333
1300
|
handleHttpRequest = /* @__PURE__ */ __name(async (nodeRequest, nodeResponse) => {
|
|
1334
1301
|
const request = normalizeNodeRequest(nodeRequest, await getFetchAPI());
|
|
@@ -1361,7 +1328,6 @@ var InterceptorServer = class {
|
|
|
1361
1328
|
}
|
|
1362
1329
|
}, "handleHttpRequest");
|
|
1363
1330
|
async createResponseForRequest(request) {
|
|
1364
|
-
const webSocketServer = this.webSocketServer();
|
|
1365
1331
|
const methodHandlers = this.httpHandlerGroups[request.method];
|
|
1366
1332
|
const requestURL = excludeURLParams_default(new URL(request.url)).toString();
|
|
1367
1333
|
let matchedSomeInterceptor = false;
|
|
@@ -1372,7 +1338,7 @@ var InterceptorServer = class {
|
|
|
1372
1338
|
continue;
|
|
1373
1339
|
}
|
|
1374
1340
|
matchedSomeInterceptor = true;
|
|
1375
|
-
const { response: serializedResponse } = await
|
|
1341
|
+
const { response: serializedResponse } = await this.webSocketServerOrThrow.request(
|
|
1376
1342
|
"interceptors/responses/create",
|
|
1377
1343
|
{ handlerId: handler.id, request },
|
|
1378
1344
|
{ sockets: [handler.socket] }
|
|
@@ -1396,11 +1362,10 @@ var InterceptorServer = class {
|
|
|
1396
1362
|
}
|
|
1397
1363
|
}
|
|
1398
1364
|
async logUnhandledRequestIfNecessary(request, serializedRequest) {
|
|
1399
|
-
const webSocketServer = this.webSocketServer();
|
|
1400
1365
|
const handler = this.findHttpHandlerByRequestBaseURL(request);
|
|
1401
1366
|
if (handler) {
|
|
1402
1367
|
try {
|
|
1403
|
-
const { wasLogged: wasRequestLoggedByRemoteInterceptor } = await
|
|
1368
|
+
const { wasLogged: wasRequestLoggedByRemoteInterceptor } = await this.webSocketServerOrThrow.request(
|
|
1404
1369
|
"interceptors/responses/unhandled",
|
|
1405
1370
|
{ request: serializedRequest },
|
|
1406
1371
|
{ sockets: [handler.socket] }
|
|
@@ -1415,7 +1380,7 @@ var InterceptorServer = class {
|
|
|
1415
1380
|
}
|
|
1416
1381
|
}
|
|
1417
1382
|
}
|
|
1418
|
-
if (!this.
|
|
1383
|
+
if (!this.logUnhandledRequests) {
|
|
1419
1384
|
return;
|
|
1420
1385
|
}
|
|
1421
1386
|
await HttpInterceptorWorker_default.logUnhandledRequestWarning(request, "reject");
|
|
@@ -1482,5 +1447,5 @@ var interceptorServer = Object.freeze(new InterceptorServerNamespace_default());
|
|
|
1482
1447
|
* Since simulating this scenario is difficult, we are ignoring this branch fow now. */
|
|
1483
1448
|
|
|
1484
1449
|
export { DEFAULT_ACCESS_CONTROL_HEADERS, DEFAULT_PREFLIGHT_STATUS_CODE, NotStartedInterceptorServerError_default, createCachedDynamicImport_default, interceptorServer, logWithPrefix };
|
|
1485
|
-
//# sourceMappingURL=chunk-
|
|
1486
|
-
//# sourceMappingURL=chunk-
|
|
1450
|
+
//# sourceMappingURL=chunk-3O3YPVEG.mjs.map
|
|
1451
|
+
//# sourceMappingURL=chunk-3O3YPVEG.mjs.map
|