Update checked-in dependencies
This commit is contained in:
parent
55ff016766
commit
313daefcef
1570 changed files with 4230 additions and 228668 deletions
|
|
@ -70,8 +70,9 @@ var _FetchResponse = class extends Response {
|
|||
const safeStatus = _FetchResponse.isConfigurableStatusCode(status) ? status : 200;
|
||||
const finalBody = _FetchResponse.isResponseWithBody(status) ? body : null;
|
||||
super(finalBody, {
|
||||
...init,
|
||||
status: safeStatus
|
||||
status: safeStatus,
|
||||
statusText: init.statusText,
|
||||
headers: init.headers
|
||||
});
|
||||
if (status !== safeStatus) {
|
||||
const state = getValueBySymbol("state", this);
|
||||
|
|
@ -113,4 +114,4 @@ export {
|
|||
getRawRequest,
|
||||
setRawRequest
|
||||
};
|
||||
//# sourceMappingURL=chunk-CNX33NZA.mjs.map
|
||||
//# sourceMappingURL=chunk-3RXCRGL2.mjs.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -8,7 +8,7 @@ import {
|
|||
IS_PATCHED_MODULE,
|
||||
canParseUrl,
|
||||
setRawRequest
|
||||
} from "./chunk-CNX33NZA.mjs";
|
||||
} from "./chunk-3RXCRGL2.mjs";
|
||||
import {
|
||||
hasConfigurableGlobal
|
||||
} from "./chunk-TX5GBTFY.mjs";
|
||||
|
|
@ -288,4 +288,4 @@ FetchInterceptor.symbol = Symbol("fetch");
|
|||
export {
|
||||
FetchInterceptor
|
||||
};
|
||||
//# sourceMappingURL=chunk-SKG3GP7X.mjs.map
|
||||
//# sourceMappingURL=chunk-ARPHZXGT.mjs.map
|
||||
|
|
@ -11,7 +11,7 @@ var _chunkGTJ35JP4js = require('./chunk-GTJ35JP4.js');
|
|||
|
||||
|
||||
|
||||
var _chunkMSUVVHIGjs = require('./chunk-MSUVVHIG.js');
|
||||
var _chunkT7TBRNJZjs = require('./chunk-T7TBRNJZ.js');
|
||||
|
||||
|
||||
var _chunkPFGO5BSMjs = require('./chunk-PFGO5BSM.js');
|
||||
|
|
@ -207,8 +207,8 @@ function parseJson(data) {
|
|||
|
||||
// src/interceptors/XMLHttpRequest/utils/createResponse.ts
|
||||
function createResponse(request, body) {
|
||||
const responseBodyOrNull = _chunkMSUVVHIGjs.FetchResponse.isResponseWithBody(request.status) ? body : null;
|
||||
return new (0, _chunkMSUVVHIGjs.FetchResponse)(responseBodyOrNull, {
|
||||
const responseBodyOrNull = _chunkT7TBRNJZjs.FetchResponse.isResponseWithBody(request.status) ? body : null;
|
||||
return new (0, _chunkT7TBRNJZjs.FetchResponse)(responseBodyOrNull, {
|
||||
url: request.responseURL,
|
||||
status: request.status,
|
||||
statusText: request.statusText,
|
||||
|
|
@ -694,7 +694,7 @@ var XMLHttpRequestController = class {
|
|||
}
|
||||
});
|
||||
define(fetchRequest, "headers", proxyHeaders);
|
||||
_chunkMSUVVHIGjs.setRawRequest.call(void 0, fetchRequest, this.request);
|
||||
_chunkT7TBRNJZjs.setRawRequest.call(void 0, fetchRequest, this.request);
|
||||
this.logger.info("converted request to a Fetch API Request!", fetchRequest);
|
||||
return fetchRequest;
|
||||
}
|
||||
|
|
@ -809,7 +809,7 @@ var _XMLHttpRequestInterceptor = class extends _chunkTIPR373Rjs.Interceptor {
|
|||
logger.info('patching "XMLHttpRequest" module...');
|
||||
const PureXMLHttpRequest = globalThis.XMLHttpRequest;
|
||||
_outvariant.invariant.call(void 0,
|
||||
!PureXMLHttpRequest[_chunkMSUVVHIGjs.IS_PATCHED_MODULE],
|
||||
!PureXMLHttpRequest[_chunkT7TBRNJZjs.IS_PATCHED_MODULE],
|
||||
'Failed to patch the "XMLHttpRequest" module: already patched.'
|
||||
);
|
||||
globalThis.XMLHttpRequest = createXMLHttpRequestProxy({
|
||||
|
|
@ -820,13 +820,13 @@ var _XMLHttpRequestInterceptor = class extends _chunkTIPR373Rjs.Interceptor {
|
|||
'native "XMLHttpRequest" module patched!',
|
||||
globalThis.XMLHttpRequest.name
|
||||
);
|
||||
Object.defineProperty(globalThis.XMLHttpRequest, _chunkMSUVVHIGjs.IS_PATCHED_MODULE, {
|
||||
Object.defineProperty(globalThis.XMLHttpRequest, _chunkT7TBRNJZjs.IS_PATCHED_MODULE, {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
value: true
|
||||
});
|
||||
this.subscriptions.push(() => {
|
||||
Object.defineProperty(globalThis.XMLHttpRequest, _chunkMSUVVHIGjs.IS_PATCHED_MODULE, {
|
||||
Object.defineProperty(globalThis.XMLHttpRequest, _chunkT7TBRNJZjs.IS_PATCHED_MODULE, {
|
||||
value: void 0
|
||||
});
|
||||
globalThis.XMLHttpRequest = PureXMLHttpRequest;
|
||||
|
|
@ -843,4 +843,4 @@ XMLHttpRequestInterceptor.interceptorSymbol = Symbol("xhr");
|
|||
|
||||
|
||||
exports.XMLHttpRequestInterceptor = XMLHttpRequestInterceptor;
|
||||
//# sourceMappingURL=chunk-O2RCNIMR.js.map
|
||||
//# sourceMappingURL=chunk-L4DRUEKJ.js.map
|
||||
1
node_modules/@mswjs/interceptors/lib/browser/chunk-MSUVVHIG.js.map
generated
vendored
1
node_modules/@mswjs/interceptors/lib/browser/chunk-MSUVVHIG.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -8,7 +8,7 @@ var _chunkGTJ35JP4js = require('./chunk-GTJ35JP4.js');
|
|||
|
||||
|
||||
|
||||
var _chunkMSUVVHIGjs = require('./chunk-MSUVVHIG.js');
|
||||
var _chunkT7TBRNJZjs = require('./chunk-T7TBRNJZ.js');
|
||||
|
||||
|
||||
var _chunkPFGO5BSMjs = require('./chunk-PFGO5BSM.js');
|
||||
|
|
@ -172,15 +172,15 @@ var _FetchInterceptor = class extends _chunkTIPR373Rjs.Interceptor {
|
|||
async setup() {
|
||||
const pureFetch = globalThis.fetch;
|
||||
_outvariant.invariant.call(void 0,
|
||||
!pureFetch[_chunkMSUVVHIGjs.IS_PATCHED_MODULE],
|
||||
!pureFetch[_chunkT7TBRNJZjs.IS_PATCHED_MODULE],
|
||||
'Failed to patch the "fetch" module: already patched.'
|
||||
);
|
||||
globalThis.fetch = async (input, init) => {
|
||||
const requestId = _chunkTIPR373Rjs.createRequestId.call(void 0, );
|
||||
const resolvedInput = typeof input === "string" && typeof location !== "undefined" && !_chunkMSUVVHIGjs.canParseUrl.call(void 0, input) ? new URL(input, location.href) : input;
|
||||
const resolvedInput = typeof input === "string" && typeof location !== "undefined" && !_chunkT7TBRNJZjs.canParseUrl.call(void 0, input) ? new URL(input, location.href) : input;
|
||||
const request = new Request(resolvedInput, init);
|
||||
if (input instanceof Request) {
|
||||
_chunkMSUVVHIGjs.setRawRequest.call(void 0, request, input);
|
||||
_chunkT7TBRNJZjs.setRawRequest.call(void 0, request, input);
|
||||
}
|
||||
const responsePromise = new (0, _deferredpromise.DeferredPromise)();
|
||||
const controller = new (0, _chunkGTJ35JP4js.RequestController)(request);
|
||||
|
|
@ -200,9 +200,9 @@ var _FetchInterceptor = class extends _chunkTIPR373Rjs.Interceptor {
|
|||
rawResponse
|
||||
});
|
||||
const decompressedStream = decompressResponse(rawResponse);
|
||||
const response = decompressedStream === null ? rawResponse : new (0, _chunkMSUVVHIGjs.FetchResponse)(decompressedStream, rawResponse);
|
||||
_chunkMSUVVHIGjs.FetchResponse.setUrl(request.url, response);
|
||||
if (_chunkMSUVVHIGjs.FetchResponse.isRedirectResponse(response.status)) {
|
||||
const response = decompressedStream === null ? rawResponse : new (0, _chunkT7TBRNJZjs.FetchResponse)(decompressedStream, rawResponse);
|
||||
_chunkT7TBRNJZjs.FetchResponse.setUrl(request.url, response);
|
||||
if (_chunkT7TBRNJZjs.FetchResponse.isRedirectResponse(response.status)) {
|
||||
if (request.redirect === "error") {
|
||||
responsePromise.reject(createNetworkError("unexpected redirect"));
|
||||
return;
|
||||
|
|
@ -265,13 +265,13 @@ var _FetchInterceptor = class extends _chunkTIPR373Rjs.Interceptor {
|
|||
return response;
|
||||
});
|
||||
};
|
||||
Object.defineProperty(globalThis.fetch, _chunkMSUVVHIGjs.IS_PATCHED_MODULE, {
|
||||
Object.defineProperty(globalThis.fetch, _chunkT7TBRNJZjs.IS_PATCHED_MODULE, {
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
value: true
|
||||
});
|
||||
this.subscriptions.push(() => {
|
||||
Object.defineProperty(globalThis.fetch, _chunkMSUVVHIGjs.IS_PATCHED_MODULE, {
|
||||
Object.defineProperty(globalThis.fetch, _chunkT7TBRNJZjs.IS_PATCHED_MODULE, {
|
||||
value: void 0
|
||||
});
|
||||
globalThis.fetch = pureFetch;
|
||||
|
|
@ -288,4 +288,4 @@ FetchInterceptor.symbol = Symbol("fetch");
|
|||
|
||||
|
||||
exports.FetchInterceptor = FetchInterceptor;
|
||||
//# sourceMappingURL=chunk-UY4VLZVB.js.map
|
||||
//# sourceMappingURL=chunk-OTQFOPZM.js.map
|
||||
|
|
@ -11,7 +11,7 @@ import {
|
|||
FetchResponse,
|
||||
IS_PATCHED_MODULE,
|
||||
setRawRequest
|
||||
} from "./chunk-CNX33NZA.mjs";
|
||||
} from "./chunk-3RXCRGL2.mjs";
|
||||
import {
|
||||
hasConfigurableGlobal
|
||||
} from "./chunk-TX5GBTFY.mjs";
|
||||
|
|
@ -843,4 +843,4 @@ XMLHttpRequestInterceptor.interceptorSymbol = Symbol("xhr");
|
|||
export {
|
||||
XMLHttpRequestInterceptor
|
||||
};
|
||||
//# sourceMappingURL=chunk-7RPAMWJ6.mjs.map
|
||||
//# sourceMappingURL=chunk-QKSBFQDK.mjs.map
|
||||
|
|
@ -70,8 +70,9 @@ var _FetchResponse = class extends Response {
|
|||
const safeStatus = _FetchResponse.isConfigurableStatusCode(status) ? status : 200;
|
||||
const finalBody = _FetchResponse.isResponseWithBody(status) ? body : null;
|
||||
super(finalBody, {
|
||||
...init,
|
||||
status: safeStatus
|
||||
status: safeStatus,
|
||||
statusText: init.statusText,
|
||||
headers: init.headers
|
||||
});
|
||||
if (status !== safeStatus) {
|
||||
const state = getValueBySymbol("state", this);
|
||||
|
|
@ -113,4 +114,4 @@ function setRawRequest(request, rawRequest) {
|
|||
|
||||
|
||||
exports.IS_PATCHED_MODULE = IS_PATCHED_MODULE; exports.canParseUrl = canParseUrl; exports.FetchResponse = FetchResponse; exports.getRawRequest = getRawRequest; exports.setRawRequest = setRawRequest;
|
||||
//# sourceMappingURL=chunk-MSUVVHIG.js.map
|
||||
//# sourceMappingURL=chunk-T7TBRNJZ.js.map
|
||||
1
node_modules/@mswjs/interceptors/lib/browser/chunk-T7TBRNJZ.js.map
generated
vendored
Normal file
1
node_modules/@mswjs/interceptors/lib/browser/chunk-T7TBRNJZ.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
4
node_modules/@mswjs/interceptors/lib/browser/index.js
generated
vendored
4
node_modules/@mswjs/interceptors/lib/browser/index.js
generated
vendored
|
|
@ -6,7 +6,7 @@ var _chunkLK6DILFKjs = require('./chunk-LK6DILFK.js');
|
|||
|
||||
|
||||
|
||||
var _chunkMSUVVHIGjs = require('./chunk-MSUVVHIG.js');
|
||||
var _chunkT7TBRNJZjs = require('./chunk-T7TBRNJZ.js');
|
||||
|
||||
|
||||
|
||||
|
|
@ -77,5 +77,5 @@ function getCleanUrl(url, isAbsolute = true) {
|
|||
|
||||
|
||||
|
||||
exports.BatchInterceptor = BatchInterceptor; exports.FetchResponse = _chunkMSUVVHIGjs.FetchResponse; exports.INTERNAL_REQUEST_ID_HEADER_NAME = _chunkTIPR373Rjs.INTERNAL_REQUEST_ID_HEADER_NAME; exports.IS_PATCHED_MODULE = _chunkMSUVVHIGjs.IS_PATCHED_MODULE; exports.Interceptor = _chunkTIPR373Rjs.Interceptor; exports.InterceptorReadyState = _chunkTIPR373Rjs.InterceptorReadyState; exports.createRequestId = _chunkTIPR373Rjs.createRequestId; exports.decodeBuffer = _chunkLK6DILFKjs.decodeBuffer; exports.deleteGlobalSymbol = _chunkTIPR373Rjs.deleteGlobalSymbol; exports.encodeBuffer = _chunkLK6DILFKjs.encodeBuffer; exports.getCleanUrl = getCleanUrl; exports.getGlobalSymbol = _chunkTIPR373Rjs.getGlobalSymbol; exports.getRawRequest = _chunkMSUVVHIGjs.getRawRequest;
|
||||
exports.BatchInterceptor = BatchInterceptor; exports.FetchResponse = _chunkT7TBRNJZjs.FetchResponse; exports.INTERNAL_REQUEST_ID_HEADER_NAME = _chunkTIPR373Rjs.INTERNAL_REQUEST_ID_HEADER_NAME; exports.IS_PATCHED_MODULE = _chunkT7TBRNJZjs.IS_PATCHED_MODULE; exports.Interceptor = _chunkTIPR373Rjs.Interceptor; exports.InterceptorReadyState = _chunkTIPR373Rjs.InterceptorReadyState; exports.createRequestId = _chunkTIPR373Rjs.createRequestId; exports.decodeBuffer = _chunkLK6DILFKjs.decodeBuffer; exports.deleteGlobalSymbol = _chunkTIPR373Rjs.deleteGlobalSymbol; exports.encodeBuffer = _chunkLK6DILFKjs.encodeBuffer; exports.getCleanUrl = getCleanUrl; exports.getGlobalSymbol = _chunkTIPR373Rjs.getGlobalSymbol; exports.getRawRequest = _chunkT7TBRNJZjs.getRawRequest;
|
||||
//# sourceMappingURL=index.js.map
|
||||
2
node_modules/@mswjs/interceptors/lib/browser/index.mjs
generated
vendored
2
node_modules/@mswjs/interceptors/lib/browser/index.mjs
generated
vendored
|
|
@ -6,7 +6,7 @@ import {
|
|||
FetchResponse,
|
||||
IS_PATCHED_MODULE,
|
||||
getRawRequest
|
||||
} from "./chunk-CNX33NZA.mjs";
|
||||
} from "./chunk-3RXCRGL2.mjs";
|
||||
import {
|
||||
INTERNAL_REQUEST_ID_HEADER_NAME,
|
||||
Interceptor,
|
||||
|
|
|
|||
6
node_modules/@mswjs/interceptors/lib/browser/interceptors/XMLHttpRequest/index.js
generated
vendored
6
node_modules/@mswjs/interceptors/lib/browser/interceptors/XMLHttpRequest/index.js
generated
vendored
|
|
@ -1,12 +1,12 @@
|
|||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
||||
|
||||
var _chunkO2RCNIMRjs = require('../../chunk-O2RCNIMR.js');
|
||||
var _chunkL4DRUEKJjs = require('../../chunk-L4DRUEKJ.js');
|
||||
require('../../chunk-LK6DILFK.js');
|
||||
require('../../chunk-GTJ35JP4.js');
|
||||
require('../../chunk-MSUVVHIG.js');
|
||||
require('../../chunk-T7TBRNJZ.js');
|
||||
require('../../chunk-PFGO5BSM.js');
|
||||
require('../../chunk-TIPR373R.js');
|
||||
|
||||
|
||||
exports.XMLHttpRequestInterceptor = _chunkO2RCNIMRjs.XMLHttpRequestInterceptor;
|
||||
exports.XMLHttpRequestInterceptor = _chunkL4DRUEKJjs.XMLHttpRequestInterceptor;
|
||||
//# sourceMappingURL=index.js.map
|
||||
4
node_modules/@mswjs/interceptors/lib/browser/interceptors/XMLHttpRequest/index.mjs
generated
vendored
4
node_modules/@mswjs/interceptors/lib/browser/interceptors/XMLHttpRequest/index.mjs
generated
vendored
|
|
@ -1,9 +1,9 @@
|
|||
import {
|
||||
XMLHttpRequestInterceptor
|
||||
} from "../../chunk-7RPAMWJ6.mjs";
|
||||
} from "../../chunk-QKSBFQDK.mjs";
|
||||
import "../../chunk-6HYIRFX2.mjs";
|
||||
import "../../chunk-L37TY7LC.mjs";
|
||||
import "../../chunk-CNX33NZA.mjs";
|
||||
import "../../chunk-3RXCRGL2.mjs";
|
||||
import "../../chunk-TX5GBTFY.mjs";
|
||||
import "../../chunk-QED3Q6Z2.mjs";
|
||||
export {
|
||||
|
|
|
|||
6
node_modules/@mswjs/interceptors/lib/browser/interceptors/fetch/index.js
generated
vendored
6
node_modules/@mswjs/interceptors/lib/browser/interceptors/fetch/index.js
generated
vendored
|
|
@ -1,11 +1,11 @@
|
|||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
||||
|
||||
var _chunkUY4VLZVBjs = require('../../chunk-UY4VLZVB.js');
|
||||
var _chunkOTQFOPZMjs = require('../../chunk-OTQFOPZM.js');
|
||||
require('../../chunk-GTJ35JP4.js');
|
||||
require('../../chunk-MSUVVHIG.js');
|
||||
require('../../chunk-T7TBRNJZ.js');
|
||||
require('../../chunk-PFGO5BSM.js');
|
||||
require('../../chunk-TIPR373R.js');
|
||||
|
||||
|
||||
exports.FetchInterceptor = _chunkUY4VLZVBjs.FetchInterceptor;
|
||||
exports.FetchInterceptor = _chunkOTQFOPZMjs.FetchInterceptor;
|
||||
//# sourceMappingURL=index.js.map
|
||||
4
node_modules/@mswjs/interceptors/lib/browser/interceptors/fetch/index.mjs
generated
vendored
4
node_modules/@mswjs/interceptors/lib/browser/interceptors/fetch/index.mjs
generated
vendored
|
|
@ -1,8 +1,8 @@
|
|||
import {
|
||||
FetchInterceptor
|
||||
} from "../../chunk-SKG3GP7X.mjs";
|
||||
} from "../../chunk-ARPHZXGT.mjs";
|
||||
import "../../chunk-L37TY7LC.mjs";
|
||||
import "../../chunk-CNX33NZA.mjs";
|
||||
import "../../chunk-3RXCRGL2.mjs";
|
||||
import "../../chunk-TX5GBTFY.mjs";
|
||||
import "../../chunk-QED3Q6Z2.mjs";
|
||||
export {
|
||||
|
|
|
|||
10
node_modules/@mswjs/interceptors/lib/browser/presets/browser.js
generated
vendored
10
node_modules/@mswjs/interceptors/lib/browser/presets/browser.js
generated
vendored
|
|
@ -1,19 +1,19 @@
|
|||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
||||
|
||||
var _chunkO2RCNIMRjs = require('../chunk-O2RCNIMR.js');
|
||||
var _chunkL4DRUEKJjs = require('../chunk-L4DRUEKJ.js');
|
||||
require('../chunk-LK6DILFK.js');
|
||||
|
||||
|
||||
var _chunkUY4VLZVBjs = require('../chunk-UY4VLZVB.js');
|
||||
var _chunkOTQFOPZMjs = require('../chunk-OTQFOPZM.js');
|
||||
require('../chunk-GTJ35JP4.js');
|
||||
require('../chunk-MSUVVHIG.js');
|
||||
require('../chunk-T7TBRNJZ.js');
|
||||
require('../chunk-PFGO5BSM.js');
|
||||
require('../chunk-TIPR373R.js');
|
||||
|
||||
// src/presets/browser.ts
|
||||
var browser_default = [
|
||||
new (0, _chunkUY4VLZVBjs.FetchInterceptor)(),
|
||||
new (0, _chunkO2RCNIMRjs.XMLHttpRequestInterceptor)()
|
||||
new (0, _chunkOTQFOPZMjs.FetchInterceptor)(),
|
||||
new (0, _chunkL4DRUEKJjs.XMLHttpRequestInterceptor)()
|
||||
];
|
||||
|
||||
|
||||
|
|
|
|||
6
node_modules/@mswjs/interceptors/lib/browser/presets/browser.mjs
generated
vendored
6
node_modules/@mswjs/interceptors/lib/browser/presets/browser.mjs
generated
vendored
|
|
@ -1,12 +1,12 @@
|
|||
import {
|
||||
XMLHttpRequestInterceptor
|
||||
} from "../chunk-7RPAMWJ6.mjs";
|
||||
} from "../chunk-QKSBFQDK.mjs";
|
||||
import "../chunk-6HYIRFX2.mjs";
|
||||
import {
|
||||
FetchInterceptor
|
||||
} from "../chunk-SKG3GP7X.mjs";
|
||||
} from "../chunk-ARPHZXGT.mjs";
|
||||
import "../chunk-L37TY7LC.mjs";
|
||||
import "../chunk-CNX33NZA.mjs";
|
||||
import "../chunk-3RXCRGL2.mjs";
|
||||
import "../chunk-TX5GBTFY.mjs";
|
||||
import "../chunk-QED3Q6Z2.mjs";
|
||||
|
||||
|
|
|
|||
22
node_modules/@mswjs/interceptors/lib/node/RemoteHttpInterceptor.js
generated
vendored
22
node_modules/@mswjs/interceptors/lib/node/RemoteHttpInterceptor.js
generated
vendored
|
|
@ -1,17 +1,17 @@
|
|||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
||||
|
||||
var _chunkMCB574K6js = require('./chunk-MCB574K6.js');
|
||||
var _chunkR6JVCM7Xjs = require('./chunk-R6JVCM7X.js');
|
||||
|
||||
|
||||
var _chunkRA7KLLRDjs = require('./chunk-RA7KLLRD.js');
|
||||
var _chunkZAIODWHAjs = require('./chunk-ZAIODWHA.js');
|
||||
require('./chunk-4YBV77DG.js');
|
||||
|
||||
|
||||
var _chunkR7MWIVYWjs = require('./chunk-R7MWIVYW.js');
|
||||
var _chunk4WG2AM2Tjs = require('./chunk-4WG2AM2T.js');
|
||||
require('./chunk-LK6DILFK.js');
|
||||
|
||||
|
||||
var _chunkK4I5GNXUjs = require('./chunk-K4I5GNXU.js');
|
||||
var _chunkYAIEISARjs = require('./chunk-YAIEISAR.js');
|
||||
require('./chunk-PFGO5BSM.js');
|
||||
require('./chunk-73NOP3T5.js');
|
||||
|
||||
|
|
@ -21,18 +21,18 @@ var _chunkC2JSMMHYjs = require('./chunk-C2JSMMHY.js');
|
|||
|
||||
|
||||
|
||||
var _chunkDLID3GDGjs = require('./chunk-DLID3GDG.js');
|
||||
var _chunkA7U44ARPjs = require('./chunk-A7U44ARP.js');
|
||||
require('./chunk-SMXZPJEA.js');
|
||||
|
||||
// src/RemoteHttpInterceptor.ts
|
||||
var RemoteHttpInterceptor = class extends _chunkMCB574K6js.BatchInterceptor {
|
||||
var RemoteHttpInterceptor = class extends _chunkR6JVCM7Xjs.BatchInterceptor {
|
||||
constructor() {
|
||||
super({
|
||||
name: "remote-interceptor",
|
||||
interceptors: [
|
||||
new (0, _chunkRA7KLLRDjs.ClientRequestInterceptor)(),
|
||||
new (0, _chunkR7MWIVYWjs.XMLHttpRequestInterceptor)(),
|
||||
new (0, _chunkK4I5GNXUjs.FetchInterceptor)()
|
||||
new (0, _chunkZAIODWHAjs.ClientRequestInterceptor)(),
|
||||
new (0, _chunk4WG2AM2Tjs.XMLHttpRequestInterceptor)(),
|
||||
new (0, _chunkYAIEISARjs.FetchInterceptor)()
|
||||
]
|
||||
});
|
||||
}
|
||||
|
|
@ -67,7 +67,7 @@ var RemoteHttpInterceptor = class extends _chunkMCB574K6js.BatchInterceptor {
|
|||
const responseInit = JSON.parse(
|
||||
serializedResponse
|
||||
);
|
||||
const mockedResponse = new (0, _chunkDLID3GDGjs.FetchResponse)(responseInit.body, {
|
||||
const mockedResponse = new (0, _chunkA7U44ARPjs.FetchResponse)(responseInit.body, {
|
||||
url: request.url,
|
||||
status: responseInit.status,
|
||||
statusText: responseInit.statusText,
|
||||
|
|
@ -100,7 +100,7 @@ function requestReviver(key, value) {
|
|||
return value;
|
||||
}
|
||||
}
|
||||
var _RemoteHttpResolver = class extends _chunkDLID3GDGjs.Interceptor {
|
||||
var _RemoteHttpResolver = class extends _chunkA7U44ARPjs.Interceptor {
|
||||
constructor(options) {
|
||||
super(_RemoteHttpResolver.symbol);
|
||||
this.process = options.process;
|
||||
|
|
|
|||
10
node_modules/@mswjs/interceptors/lib/node/RemoteHttpInterceptor.mjs
generated
vendored
10
node_modules/@mswjs/interceptors/lib/node/RemoteHttpInterceptor.mjs
generated
vendored
|
|
@ -1,17 +1,17 @@
|
|||
import {
|
||||
BatchInterceptor
|
||||
} from "./chunk-TBU3WLO3.mjs";
|
||||
} from "./chunk-RC2XPCC4.mjs";
|
||||
import {
|
||||
ClientRequestInterceptor
|
||||
} from "./chunk-FHLAZ57F.mjs";
|
||||
} from "./chunk-GLGFOTGJ.mjs";
|
||||
import "./chunk-TJDMZZXE.mjs";
|
||||
import {
|
||||
XMLHttpRequestInterceptor
|
||||
} from "./chunk-3HLZLASJ.mjs";
|
||||
} from "./chunk-EADPZWWI.mjs";
|
||||
import "./chunk-6HYIRFX2.mjs";
|
||||
import {
|
||||
FetchInterceptor
|
||||
} from "./chunk-3TXENUZY.mjs";
|
||||
} from "./chunk-GL6JCI7E.mjs";
|
||||
import "./chunk-TX5GBTFY.mjs";
|
||||
import "./chunk-6YM4PLBI.mjs";
|
||||
import {
|
||||
|
|
@ -21,7 +21,7 @@ import {
|
|||
import {
|
||||
FetchResponse,
|
||||
Interceptor
|
||||
} from "./chunk-YM42IU6M.mjs";
|
||||
} from "./chunk-IHJSPMYM.mjs";
|
||||
import "./chunk-3GJB4JDF.mjs";
|
||||
|
||||
// src/RemoteHttpInterceptor.ts
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ var _chunkC2JSMMHYjs = require('./chunk-C2JSMMHY.js');
|
|||
|
||||
|
||||
|
||||
var _chunkDLID3GDGjs = require('./chunk-DLID3GDG.js');
|
||||
var _chunkA7U44ARPjs = require('./chunk-A7U44ARP.js');
|
||||
|
||||
|
||||
var _chunkSMXZPJEAjs = require('./chunk-SMXZPJEA.js');
|
||||
|
|
@ -209,8 +209,8 @@ function parseJson(data) {
|
|||
|
||||
// src/interceptors/XMLHttpRequest/utils/createResponse.ts
|
||||
function createResponse(request, body) {
|
||||
const responseBodyOrNull = _chunkDLID3GDGjs.FetchResponse.isResponseWithBody(request.status) ? body : null;
|
||||
return new (0, _chunkDLID3GDGjs.FetchResponse)(responseBodyOrNull, {
|
||||
const responseBodyOrNull = _chunkA7U44ARPjs.FetchResponse.isResponseWithBody(request.status) ? body : null;
|
||||
return new (0, _chunkA7U44ARPjs.FetchResponse)(responseBodyOrNull, {
|
||||
url: request.responseURL,
|
||||
status: request.status,
|
||||
statusText: request.statusText,
|
||||
|
|
@ -256,7 +256,7 @@ var XMLHttpRequestController = class {
|
|||
this[kIsRequestHandled] = false;
|
||||
this.events = /* @__PURE__ */ new Map();
|
||||
this.uploadEvents = /* @__PURE__ */ new Map();
|
||||
this.requestId = _chunkDLID3GDGjs.createRequestId.call(void 0, );
|
||||
this.requestId = _chunkA7U44ARPjs.createRequestId.call(void 0, );
|
||||
this.requestHeaders = new Headers();
|
||||
this.responseBuffer = new Uint8Array();
|
||||
this.request = createProxy(initialRequest, {
|
||||
|
|
@ -338,7 +338,7 @@ var XMLHttpRequestController = class {
|
|||
);
|
||||
if (IS_NODE) {
|
||||
this.request.setRequestHeader(
|
||||
_chunkDLID3GDGjs.INTERNAL_REQUEST_ID_HEADER_NAME,
|
||||
_chunkA7U44ARPjs.INTERNAL_REQUEST_ID_HEADER_NAME,
|
||||
this.requestId
|
||||
);
|
||||
}
|
||||
|
|
@ -799,7 +799,7 @@ function createXMLHttpRequestProxy({
|
|||
}
|
||||
|
||||
// src/interceptors/XMLHttpRequest/index.ts
|
||||
var _XMLHttpRequestInterceptor = class extends _chunkDLID3GDGjs.Interceptor {
|
||||
var _XMLHttpRequestInterceptor = class extends _chunkA7U44ARPjs.Interceptor {
|
||||
constructor() {
|
||||
super(_XMLHttpRequestInterceptor.interceptorSymbol);
|
||||
}
|
||||
|
|
@ -845,4 +845,4 @@ XMLHttpRequestInterceptor.interceptorSymbol = Symbol("xhr");
|
|||
|
||||
|
||||
exports.XMLHttpRequestInterceptor = XMLHttpRequestInterceptor;
|
||||
//# sourceMappingURL=chunk-R7MWIVYW.js.map
|
||||
//# sourceMappingURL=chunk-4WG2AM2T.js.map
|
||||
|
|
@ -227,8 +227,9 @@ var _FetchResponse = class extends Response {
|
|||
const safeStatus = _FetchResponse.isConfigurableStatusCode(status) ? status : 200;
|
||||
const finalBody = _FetchResponse.isResponseWithBody(status) ? body : null;
|
||||
super(finalBody, {
|
||||
...init,
|
||||
status: safeStatus
|
||||
status: safeStatus,
|
||||
statusText: init.statusText,
|
||||
headers: init.headers
|
||||
});
|
||||
if (status !== safeStatus) {
|
||||
const state = getValueBySymbol("state", this);
|
||||
|
|
@ -264,4 +265,4 @@ FetchResponse.STATUS_CODES_WITH_REDIRECT = [301, 302, 303, 307, 308];
|
|||
|
||||
|
||||
exports.INTERNAL_REQUEST_ID_HEADER_NAME = INTERNAL_REQUEST_ID_HEADER_NAME; exports.getGlobalSymbol = getGlobalSymbol; exports.deleteGlobalSymbol = deleteGlobalSymbol; exports.InterceptorReadyState = InterceptorReadyState; exports.Interceptor = Interceptor; exports.createRequestId = createRequestId; exports.canParseUrl = canParseUrl; exports.FetchResponse = FetchResponse;
|
||||
//# sourceMappingURL=chunk-DLID3GDG.js.map
|
||||
//# sourceMappingURL=chunk-A7U44ARP.js.map
|
||||
1
node_modules/@mswjs/interceptors/lib/node/chunk-A7U44ARP.js.map
generated
vendored
Normal file
1
node_modules/@mswjs/interceptors/lib/node/chunk-A7U44ARP.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
1
node_modules/@mswjs/interceptors/lib/node/chunk-DLID3GDG.js.map
generated
vendored
1
node_modules/@mswjs/interceptors/lib/node/chunk-DLID3GDG.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -18,7 +18,7 @@ import {
|
|||
INTERNAL_REQUEST_ID_HEADER_NAME,
|
||||
Interceptor,
|
||||
createRequestId
|
||||
} from "./chunk-YM42IU6M.mjs";
|
||||
} from "./chunk-IHJSPMYM.mjs";
|
||||
import {
|
||||
setRawRequest
|
||||
} from "./chunk-3GJB4JDF.mjs";
|
||||
|
|
@ -845,4 +845,4 @@ XMLHttpRequestInterceptor.interceptorSymbol = Symbol("xhr");
|
|||
export {
|
||||
XMLHttpRequestInterceptor
|
||||
};
|
||||
//# sourceMappingURL=chunk-3HLZLASJ.mjs.map
|
||||
//# sourceMappingURL=chunk-EADPZWWI.mjs.map
|
||||
1
node_modules/@mswjs/interceptors/lib/node/chunk-FHLAZ57F.mjs.map
generated
vendored
1
node_modules/@mswjs/interceptors/lib/node/chunk-FHLAZ57F.mjs.map
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -14,7 +14,7 @@ import {
|
|||
Interceptor,
|
||||
canParseUrl,
|
||||
createRequestId
|
||||
} from "./chunk-YM42IU6M.mjs";
|
||||
} from "./chunk-IHJSPMYM.mjs";
|
||||
import {
|
||||
setRawRequest
|
||||
} from "./chunk-3GJB4JDF.mjs";
|
||||
|
|
@ -305,4 +305,4 @@ FetchInterceptor.symbol = Symbol("fetch");
|
|||
export {
|
||||
FetchInterceptor
|
||||
};
|
||||
//# sourceMappingURL=chunk-3TXENUZY.mjs.map
|
||||
//# sourceMappingURL=chunk-GL6JCI7E.mjs.map
|
||||
|
|
@ -14,7 +14,7 @@ import {
|
|||
INTERNAL_REQUEST_ID_HEADER_NAME,
|
||||
Interceptor,
|
||||
createRequestId
|
||||
} from "./chunk-YM42IU6M.mjs";
|
||||
} from "./chunk-IHJSPMYM.mjs";
|
||||
import {
|
||||
setRawRequest
|
||||
} from "./chunk-3GJB4JDF.mjs";
|
||||
|
|
@ -439,6 +439,13 @@ var MockHttpSocket = class extends MockSocket {
|
|||
}
|
||||
const socket = this.createConnection();
|
||||
this.originalSocket = socket;
|
||||
if ("_handle" in socket) {
|
||||
Object.defineProperty(this, "_handle", {
|
||||
value: socket._handle,
|
||||
enumerable: true,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
this.once("error", (error) => {
|
||||
socket.destroy(error);
|
||||
});
|
||||
|
|
@ -984,10 +991,30 @@ var _ClientRequestInterceptor = class extends Interceptor {
|
|||
};
|
||||
}
|
||||
setup() {
|
||||
const { get: originalGet, request: originalRequest } = http2;
|
||||
const {
|
||||
ClientRequest: OriginalClientRequest,
|
||||
get: originalGet,
|
||||
request: originalRequest
|
||||
} = http2;
|
||||
const { get: originalHttpsGet, request: originalHttpsRequest } = https2;
|
||||
const onRequest = this.onRequest.bind(this);
|
||||
const onResponse = this.onResponse.bind(this);
|
||||
http2.ClientRequest = new Proxy(http2.ClientRequest, {
|
||||
construct: (target, args) => {
|
||||
const [url, options, callback] = normalizeClientRequestArgs(
|
||||
"http:",
|
||||
args
|
||||
);
|
||||
const Agent2 = options.protocol === "https:" ? MockHttpsAgent : MockAgent;
|
||||
const mockAgent = new Agent2({
|
||||
customAgent: options.agent,
|
||||
onRequest,
|
||||
onResponse
|
||||
});
|
||||
options.agent = mockAgent;
|
||||
return Reflect.construct(target, [url, options, callback]);
|
||||
}
|
||||
});
|
||||
http2.request = new Proxy(http2.request, {
|
||||
apply: (target, thisArg, args) => {
|
||||
const [url, options, callback] = normalizeClientRequestArgs(
|
||||
|
|
@ -1050,6 +1077,7 @@ var _ClientRequestInterceptor = class extends Interceptor {
|
|||
});
|
||||
recordRawFetchHeaders();
|
||||
this.subscriptions.push(() => {
|
||||
http2.ClientRequest = OriginalClientRequest;
|
||||
http2.get = originalGet;
|
||||
http2.request = originalRequest;
|
||||
https2.get = originalHttpsGet;
|
||||
|
|
@ -1064,4 +1092,4 @@ ClientRequestInterceptor.symbol = Symbol("client-request-interceptor");
|
|||
export {
|
||||
ClientRequestInterceptor
|
||||
};
|
||||
//# sourceMappingURL=chunk-FHLAZ57F.mjs.map
|
||||
//# sourceMappingURL=chunk-GLGFOTGJ.mjs.map
|
||||
1
node_modules/@mswjs/interceptors/lib/node/chunk-GLGFOTGJ.mjs.map
generated
vendored
Normal file
1
node_modules/@mswjs/interceptors/lib/node/chunk-GLGFOTGJ.mjs.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
|
|
@ -227,8 +227,9 @@ var _FetchResponse = class extends Response {
|
|||
const safeStatus = _FetchResponse.isConfigurableStatusCode(status) ? status : 200;
|
||||
const finalBody = _FetchResponse.isResponseWithBody(status) ? body : null;
|
||||
super(finalBody, {
|
||||
...init,
|
||||
status: safeStatus
|
||||
status: safeStatus,
|
||||
statusText: init.statusText,
|
||||
headers: init.headers
|
||||
});
|
||||
if (status !== safeStatus) {
|
||||
const state = getValueBySymbol("state", this);
|
||||
|
|
@ -264,4 +265,4 @@ export {
|
|||
canParseUrl,
|
||||
FetchResponse
|
||||
};
|
||||
//# sourceMappingURL=chunk-YM42IU6M.mjs.map
|
||||
//# sourceMappingURL=chunk-IHJSPMYM.mjs.map
|
||||
File diff suppressed because one or more lines are too long
|
|
@ -1,9 +1,9 @@
|
|||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
||||
|
||||
var _chunkDLID3GDGjs = require('./chunk-DLID3GDG.js');
|
||||
var _chunkA7U44ARPjs = require('./chunk-A7U44ARP.js');
|
||||
|
||||
// src/BatchInterceptor.ts
|
||||
var BatchInterceptor = class extends _chunkDLID3GDGjs.Interceptor {
|
||||
var BatchInterceptor = class extends _chunkA7U44ARPjs.Interceptor {
|
||||
constructor(options) {
|
||||
BatchInterceptor.symbol = Symbol(options.name);
|
||||
super(BatchInterceptor.symbol);
|
||||
|
|
@ -48,4 +48,4 @@ var BatchInterceptor = class extends _chunkDLID3GDGjs.Interceptor {
|
|||
|
||||
|
||||
exports.BatchInterceptor = BatchInterceptor;
|
||||
//# sourceMappingURL=chunk-MCB574K6.js.map
|
||||
//# sourceMappingURL=chunk-R6JVCM7X.js.map
|
||||
1
node_modules/@mswjs/interceptors/lib/node/chunk-RA7KLLRD.js.map
generated
vendored
1
node_modules/@mswjs/interceptors/lib/node/chunk-RA7KLLRD.js.map
generated
vendored
File diff suppressed because one or more lines are too long
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
Interceptor
|
||||
} from "./chunk-YM42IU6M.mjs";
|
||||
} from "./chunk-IHJSPMYM.mjs";
|
||||
|
||||
// src/BatchInterceptor.ts
|
||||
var BatchInterceptor = class extends Interceptor {
|
||||
|
|
@ -48,4 +48,4 @@ var BatchInterceptor = class extends Interceptor {
|
|||
export {
|
||||
BatchInterceptor
|
||||
};
|
||||
//# sourceMappingURL=chunk-TBU3WLO3.mjs.map
|
||||
//# sourceMappingURL=chunk-RC2XPCC4.mjs.map
|
||||
|
|
@ -14,7 +14,7 @@ var _chunkC2JSMMHYjs = require('./chunk-C2JSMMHY.js');
|
|||
|
||||
|
||||
|
||||
var _chunkDLID3GDGjs = require('./chunk-DLID3GDG.js');
|
||||
var _chunkA7U44ARPjs = require('./chunk-A7U44ARP.js');
|
||||
|
||||
|
||||
var _chunkSMXZPJEAjs = require('./chunk-SMXZPJEA.js');
|
||||
|
|
@ -179,7 +179,7 @@ function decompressResponse(response) {
|
|||
}
|
||||
|
||||
// src/interceptors/fetch/index.ts
|
||||
var _FetchInterceptor = class extends _chunkDLID3GDGjs.Interceptor {
|
||||
var _FetchInterceptor = class extends _chunkA7U44ARPjs.Interceptor {
|
||||
constructor() {
|
||||
super(_FetchInterceptor.symbol);
|
||||
}
|
||||
|
|
@ -193,8 +193,8 @@ var _FetchInterceptor = class extends _chunkDLID3GDGjs.Interceptor {
|
|||
'Failed to patch the "fetch" module: already patched.'
|
||||
);
|
||||
globalThis.fetch = async (input, init) => {
|
||||
const requestId = _chunkDLID3GDGjs.createRequestId.call(void 0, );
|
||||
const resolvedInput = typeof input === "string" && typeof location !== "undefined" && !_chunkDLID3GDGjs.canParseUrl.call(void 0, input) ? new URL(input, location.href) : input;
|
||||
const requestId = _chunkA7U44ARPjs.createRequestId.call(void 0, );
|
||||
const resolvedInput = typeof input === "string" && typeof location !== "undefined" && !_chunkA7U44ARPjs.canParseUrl.call(void 0, input) ? new URL(input, location.href) : input;
|
||||
const request = new Request(resolvedInput, init);
|
||||
if (input instanceof Request) {
|
||||
_chunkSMXZPJEAjs.setRawRequest.call(void 0, request, input);
|
||||
|
|
@ -217,9 +217,9 @@ var _FetchInterceptor = class extends _chunkDLID3GDGjs.Interceptor {
|
|||
rawResponse
|
||||
});
|
||||
const decompressedStream = decompressResponse(rawResponse);
|
||||
const response = decompressedStream === null ? rawResponse : new (0, _chunkDLID3GDGjs.FetchResponse)(decompressedStream, rawResponse);
|
||||
_chunkDLID3GDGjs.FetchResponse.setUrl(request.url, response);
|
||||
if (_chunkDLID3GDGjs.FetchResponse.isRedirectResponse(response.status)) {
|
||||
const response = decompressedStream === null ? rawResponse : new (0, _chunkA7U44ARPjs.FetchResponse)(decompressedStream, rawResponse);
|
||||
_chunkA7U44ARPjs.FetchResponse.setUrl(request.url, response);
|
||||
if (_chunkA7U44ARPjs.FetchResponse.isRedirectResponse(response.status)) {
|
||||
if (request.redirect === "error") {
|
||||
responsePromise.reject(createNetworkError("unexpected redirect"));
|
||||
return;
|
||||
|
|
@ -305,4 +305,4 @@ FetchInterceptor.symbol = Symbol("fetch");
|
|||
|
||||
|
||||
exports.FetchInterceptor = FetchInterceptor;
|
||||
//# sourceMappingURL=chunk-K4I5GNXU.js.map
|
||||
//# sourceMappingURL=chunk-YAIEISAR.js.map
|
||||
|
|
@ -14,7 +14,7 @@ var _chunkC2JSMMHYjs = require('./chunk-C2JSMMHY.js');
|
|||
|
||||
|
||||
|
||||
var _chunkDLID3GDGjs = require('./chunk-DLID3GDG.js');
|
||||
var _chunkA7U44ARPjs = require('./chunk-A7U44ARP.js');
|
||||
|
||||
|
||||
var _chunkSMXZPJEAjs = require('./chunk-SMXZPJEA.js');
|
||||
|
|
@ -311,7 +311,7 @@ var MockHttpSocket = class extends MockSocket {
|
|||
this.shouldKeepAlive = shouldKeepAlive;
|
||||
const url = new URL(path, this.baseUrl);
|
||||
const method = ((_a = this.connectionOptions.method) == null ? void 0 : _a.toUpperCase()) || "GET";
|
||||
const headers = _chunkDLID3GDGjs.FetchResponse.parseRawHeaders(rawHeaders);
|
||||
const headers = _chunkA7U44ARPjs.FetchResponse.parseRawHeaders(rawHeaders);
|
||||
const canHaveBody = method !== "GET" && method !== "HEAD";
|
||||
if (url.username || url.password) {
|
||||
if (!headers.has("authorization")) {
|
||||
|
|
@ -330,7 +330,7 @@ var MockHttpSocket = class extends MockSocket {
|
|||
this.flushWriteBuffer();
|
||||
}
|
||||
});
|
||||
const requestId = _chunkDLID3GDGjs.createRequestId.call(void 0, );
|
||||
const requestId = _chunkA7U44ARPjs.createRequestId.call(void 0, );
|
||||
this.request = new Request(url, {
|
||||
method,
|
||||
headers,
|
||||
|
|
@ -342,7 +342,7 @@ var MockHttpSocket = class extends MockSocket {
|
|||
Reflect.set(this.request, kRequestId, requestId);
|
||||
_chunkSMXZPJEAjs.setRawRequest.call(void 0, this.request, Reflect.get(this, "_httpMessage"));
|
||||
_chunk4YBV77DGjs.setRawRequestBodyStream.call(void 0, this.request, this.requestStream);
|
||||
if (this.request.headers.has(_chunkDLID3GDGjs.INTERNAL_REQUEST_ID_HEADER_NAME)) {
|
||||
if (this.request.headers.has(_chunkA7U44ARPjs.INTERNAL_REQUEST_ID_HEADER_NAME)) {
|
||||
this.passthrough();
|
||||
return;
|
||||
}
|
||||
|
|
@ -353,8 +353,8 @@ var MockHttpSocket = class extends MockSocket {
|
|||
});
|
||||
};
|
||||
this.onResponseStart = (versionMajor, versionMinor, rawHeaders, method, url, status, statusText) => {
|
||||
const headers = _chunkDLID3GDGjs.FetchResponse.parseRawHeaders(rawHeaders);
|
||||
const response = new (0, _chunkDLID3GDGjs.FetchResponse)(
|
||||
const headers = _chunkA7U44ARPjs.FetchResponse.parseRawHeaders(rawHeaders);
|
||||
const response = new (0, _chunkA7U44ARPjs.FetchResponse)(
|
||||
/**
|
||||
* @note The Fetch API response instance exposed to the consumer
|
||||
* is created over the response stream of the HTTP parser. It is NOT
|
||||
|
|
@ -362,7 +362,7 @@ var MockHttpSocket = class extends MockSocket {
|
|||
* in response listener while the Socket instance delays the emission
|
||||
* of "end" and other events until those response listeners are finished.
|
||||
*/
|
||||
_chunkDLID3GDGjs.FetchResponse.isResponseWithBody(status) ? _stream.Readable.toWeb(
|
||||
_chunkA7U44ARPjs.FetchResponse.isResponseWithBody(status) ? _stream.Readable.toWeb(
|
||||
this.responseStream = new (0, _stream.Readable)({ read() {
|
||||
} })
|
||||
) : null,
|
||||
|
|
@ -377,8 +377,8 @@ var MockHttpSocket = class extends MockSocket {
|
|||
this.request,
|
||||
"Failed to handle a response: request does not exist"
|
||||
);
|
||||
_chunkDLID3GDGjs.FetchResponse.setUrl(this.request.url, response);
|
||||
if (this.request.headers.has(_chunkDLID3GDGjs.INTERNAL_REQUEST_ID_HEADER_NAME)) {
|
||||
_chunkA7U44ARPjs.FetchResponse.setUrl(this.request.url, response);
|
||||
if (this.request.headers.has(_chunkA7U44ARPjs.INTERNAL_REQUEST_ID_HEADER_NAME)) {
|
||||
return;
|
||||
}
|
||||
this.responseListenersPromise = this.onResponse({
|
||||
|
|
@ -439,6 +439,13 @@ var MockHttpSocket = class extends MockSocket {
|
|||
}
|
||||
const socket = this.createConnection();
|
||||
this.originalSocket = socket;
|
||||
if ("_handle" in socket) {
|
||||
Object.defineProperty(this, "_handle", {
|
||||
value: socket._handle,
|
||||
enumerable: true,
|
||||
writable: true
|
||||
});
|
||||
}
|
||||
this.once("error", (error) => {
|
||||
socket.destroy(error);
|
||||
});
|
||||
|
|
@ -459,7 +466,7 @@ var MockHttpSocket = class extends MockSocket {
|
|||
);
|
||||
const rawRequestHeaders = getRawFetchHeaders(this.request.headers);
|
||||
const requestHeadersString = rawRequestHeaders.filter(([name]) => {
|
||||
return name.toLowerCase() !== _chunkDLID3GDGjs.INTERNAL_REQUEST_ID_HEADER_NAME;
|
||||
return name.toLowerCase() !== _chunkA7U44ARPjs.INTERNAL_REQUEST_ID_HEADER_NAME;
|
||||
}).map(([name, value]) => `${name}: ${value}`).join("\r\n");
|
||||
const headersChunk = `${chunkBeforeRequestHeaders}${requestHeadersString}${chunkAfterRequestHeaders}`;
|
||||
socket.write(headersChunk, encoding, callback);
|
||||
|
|
@ -939,7 +946,7 @@ function normalizeClientRequestArgs(defaultProtocol, args) {
|
|||
}
|
||||
|
||||
// src/interceptors/ClientRequest/index.ts
|
||||
var _ClientRequestInterceptor = class extends _chunkDLID3GDGjs.Interceptor {
|
||||
var _ClientRequestInterceptor = class extends _chunkA7U44ARPjs.Interceptor {
|
||||
constructor() {
|
||||
super(_ClientRequestInterceptor.symbol);
|
||||
this.onRequest = async ({
|
||||
|
|
@ -984,10 +991,30 @@ var _ClientRequestInterceptor = class extends _chunkDLID3GDGjs.Interceptor {
|
|||
};
|
||||
}
|
||||
setup() {
|
||||
const { get: originalGet, request: originalRequest } = _http2.default;
|
||||
const {
|
||||
ClientRequest: OriginalClientRequest,
|
||||
get: originalGet,
|
||||
request: originalRequest
|
||||
} = _http2.default;
|
||||
const { get: originalHttpsGet, request: originalHttpsRequest } = _https2.default;
|
||||
const onRequest = this.onRequest.bind(this);
|
||||
const onResponse = this.onResponse.bind(this);
|
||||
_http2.default.ClientRequest = new Proxy(_http2.default.ClientRequest, {
|
||||
construct: (target, args) => {
|
||||
const [url, options, callback] = normalizeClientRequestArgs(
|
||||
"http:",
|
||||
args
|
||||
);
|
||||
const Agent2 = options.protocol === "https:" ? MockHttpsAgent : MockAgent;
|
||||
const mockAgent = new Agent2({
|
||||
customAgent: options.agent,
|
||||
onRequest,
|
||||
onResponse
|
||||
});
|
||||
options.agent = mockAgent;
|
||||
return Reflect.construct(target, [url, options, callback]);
|
||||
}
|
||||
});
|
||||
_http2.default.request = new Proxy(_http2.default.request, {
|
||||
apply: (target, thisArg, args) => {
|
||||
const [url, options, callback] = normalizeClientRequestArgs(
|
||||
|
|
@ -1050,6 +1077,7 @@ var _ClientRequestInterceptor = class extends _chunkDLID3GDGjs.Interceptor {
|
|||
});
|
||||
recordRawFetchHeaders();
|
||||
this.subscriptions.push(() => {
|
||||
_http2.default.ClientRequest = OriginalClientRequest;
|
||||
_http2.default.get = originalGet;
|
||||
_http2.default.request = originalRequest;
|
||||
_https2.default.get = originalHttpsGet;
|
||||
|
|
@ -1064,4 +1092,4 @@ ClientRequestInterceptor.symbol = Symbol("client-request-interceptor");
|
|||
|
||||
|
||||
exports.ClientRequestInterceptor = ClientRequestInterceptor;
|
||||
//# sourceMappingURL=chunk-RA7KLLRD.js.map
|
||||
//# sourceMappingURL=chunk-ZAIODWHA.js.map
|
||||
1
node_modules/@mswjs/interceptors/lib/node/chunk-ZAIODWHA.js.map
generated
vendored
Normal file
1
node_modules/@mswjs/interceptors/lib/node/chunk-ZAIODWHA.js.map
generated
vendored
Normal file
File diff suppressed because one or more lines are too long
6
node_modules/@mswjs/interceptors/lib/node/index.js
generated
vendored
6
node_modules/@mswjs/interceptors/lib/node/index.js
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
||||
|
||||
var _chunkMCB574K6js = require('./chunk-MCB574K6.js');
|
||||
var _chunkR6JVCM7Xjs = require('./chunk-R6JVCM7X.js');
|
||||
|
||||
|
||||
|
||||
|
|
@ -16,7 +16,7 @@ var _chunk73NOP3T5js = require('./chunk-73NOP3T5.js');
|
|||
|
||||
|
||||
|
||||
var _chunkDLID3GDGjs = require('./chunk-DLID3GDG.js');
|
||||
var _chunkA7U44ARPjs = require('./chunk-A7U44ARP.js');
|
||||
|
||||
|
||||
var _chunkSMXZPJEAjs = require('./chunk-SMXZPJEA.js');
|
||||
|
|
@ -39,5 +39,5 @@ function getCleanUrl(url, isAbsolute = true) {
|
|||
|
||||
|
||||
|
||||
exports.BatchInterceptor = _chunkMCB574K6js.BatchInterceptor; exports.FetchResponse = _chunkDLID3GDGjs.FetchResponse; exports.INTERNAL_REQUEST_ID_HEADER_NAME = _chunkDLID3GDGjs.INTERNAL_REQUEST_ID_HEADER_NAME; exports.IS_PATCHED_MODULE = _chunk73NOP3T5js.IS_PATCHED_MODULE; exports.Interceptor = _chunkDLID3GDGjs.Interceptor; exports.InterceptorReadyState = _chunkDLID3GDGjs.InterceptorReadyState; exports.createRequestId = _chunkDLID3GDGjs.createRequestId; exports.decodeBuffer = _chunkLK6DILFKjs.decodeBuffer; exports.deleteGlobalSymbol = _chunkDLID3GDGjs.deleteGlobalSymbol; exports.encodeBuffer = _chunkLK6DILFKjs.encodeBuffer; exports.getCleanUrl = getCleanUrl; exports.getGlobalSymbol = _chunkDLID3GDGjs.getGlobalSymbol; exports.getRawRequest = _chunkSMXZPJEAjs.getRawRequest;
|
||||
exports.BatchInterceptor = _chunkR6JVCM7Xjs.BatchInterceptor; exports.FetchResponse = _chunkA7U44ARPjs.FetchResponse; exports.INTERNAL_REQUEST_ID_HEADER_NAME = _chunkA7U44ARPjs.INTERNAL_REQUEST_ID_HEADER_NAME; exports.IS_PATCHED_MODULE = _chunk73NOP3T5js.IS_PATCHED_MODULE; exports.Interceptor = _chunkA7U44ARPjs.Interceptor; exports.InterceptorReadyState = _chunkA7U44ARPjs.InterceptorReadyState; exports.createRequestId = _chunkA7U44ARPjs.createRequestId; exports.decodeBuffer = _chunkLK6DILFKjs.decodeBuffer; exports.deleteGlobalSymbol = _chunkA7U44ARPjs.deleteGlobalSymbol; exports.encodeBuffer = _chunkLK6DILFKjs.encodeBuffer; exports.getCleanUrl = getCleanUrl; exports.getGlobalSymbol = _chunkA7U44ARPjs.getGlobalSymbol; exports.getRawRequest = _chunkSMXZPJEAjs.getRawRequest;
|
||||
//# sourceMappingURL=index.js.map
|
||||
4
node_modules/@mswjs/interceptors/lib/node/index.mjs
generated
vendored
4
node_modules/@mswjs/interceptors/lib/node/index.mjs
generated
vendored
|
|
@ -1,6 +1,6 @@
|
|||
import {
|
||||
BatchInterceptor
|
||||
} from "./chunk-TBU3WLO3.mjs";
|
||||
} from "./chunk-RC2XPCC4.mjs";
|
||||
import {
|
||||
decodeBuffer,
|
||||
encodeBuffer
|
||||
|
|
@ -16,7 +16,7 @@ import {
|
|||
createRequestId,
|
||||
deleteGlobalSymbol,
|
||||
getGlobalSymbol
|
||||
} from "./chunk-YM42IU6M.mjs";
|
||||
} from "./chunk-IHJSPMYM.mjs";
|
||||
import {
|
||||
getRawRequest
|
||||
} from "./chunk-3GJB4JDF.mjs";
|
||||
|
|
|
|||
6
node_modules/@mswjs/interceptors/lib/node/interceptors/ClientRequest/index.js
generated
vendored
6
node_modules/@mswjs/interceptors/lib/node/interceptors/ClientRequest/index.js
generated
vendored
|
|
@ -1,11 +1,11 @@
|
|||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
||||
|
||||
var _chunkRA7KLLRDjs = require('../../chunk-RA7KLLRD.js');
|
||||
var _chunkZAIODWHAjs = require('../../chunk-ZAIODWHA.js');
|
||||
require('../../chunk-4YBV77DG.js');
|
||||
require('../../chunk-C2JSMMHY.js');
|
||||
require('../../chunk-DLID3GDG.js');
|
||||
require('../../chunk-A7U44ARP.js');
|
||||
require('../../chunk-SMXZPJEA.js');
|
||||
|
||||
|
||||
exports.ClientRequestInterceptor = _chunkRA7KLLRDjs.ClientRequestInterceptor;
|
||||
exports.ClientRequestInterceptor = _chunkZAIODWHAjs.ClientRequestInterceptor;
|
||||
//# sourceMappingURL=index.js.map
|
||||
4
node_modules/@mswjs/interceptors/lib/node/interceptors/ClientRequest/index.mjs
generated
vendored
4
node_modules/@mswjs/interceptors/lib/node/interceptors/ClientRequest/index.mjs
generated
vendored
|
|
@ -1,9 +1,9 @@
|
|||
import {
|
||||
ClientRequestInterceptor
|
||||
} from "../../chunk-FHLAZ57F.mjs";
|
||||
} from "../../chunk-GLGFOTGJ.mjs";
|
||||
import "../../chunk-TJDMZZXE.mjs";
|
||||
import "../../chunk-LGXJ3UUF.mjs";
|
||||
import "../../chunk-YM42IU6M.mjs";
|
||||
import "../../chunk-IHJSPMYM.mjs";
|
||||
import "../../chunk-3GJB4JDF.mjs";
|
||||
export {
|
||||
ClientRequestInterceptor
|
||||
|
|
|
|||
6
node_modules/@mswjs/interceptors/lib/node/interceptors/XMLHttpRequest/index.js
generated
vendored
6
node_modules/@mswjs/interceptors/lib/node/interceptors/XMLHttpRequest/index.js
generated
vendored
|
|
@ -1,13 +1,13 @@
|
|||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
||||
|
||||
var _chunkR7MWIVYWjs = require('../../chunk-R7MWIVYW.js');
|
||||
var _chunk4WG2AM2Tjs = require('../../chunk-4WG2AM2T.js');
|
||||
require('../../chunk-LK6DILFK.js');
|
||||
require('../../chunk-PFGO5BSM.js');
|
||||
require('../../chunk-73NOP3T5.js');
|
||||
require('../../chunk-C2JSMMHY.js');
|
||||
require('../../chunk-DLID3GDG.js');
|
||||
require('../../chunk-A7U44ARP.js');
|
||||
require('../../chunk-SMXZPJEA.js');
|
||||
|
||||
|
||||
exports.XMLHttpRequestInterceptor = _chunkR7MWIVYWjs.XMLHttpRequestInterceptor;
|
||||
exports.XMLHttpRequestInterceptor = _chunk4WG2AM2Tjs.XMLHttpRequestInterceptor;
|
||||
//# sourceMappingURL=index.js.map
|
||||
4
node_modules/@mswjs/interceptors/lib/node/interceptors/XMLHttpRequest/index.mjs
generated
vendored
4
node_modules/@mswjs/interceptors/lib/node/interceptors/XMLHttpRequest/index.mjs
generated
vendored
|
|
@ -1,11 +1,11 @@
|
|||
import {
|
||||
XMLHttpRequestInterceptor
|
||||
} from "../../chunk-3HLZLASJ.mjs";
|
||||
} from "../../chunk-EADPZWWI.mjs";
|
||||
import "../../chunk-6HYIRFX2.mjs";
|
||||
import "../../chunk-TX5GBTFY.mjs";
|
||||
import "../../chunk-6YM4PLBI.mjs";
|
||||
import "../../chunk-LGXJ3UUF.mjs";
|
||||
import "../../chunk-YM42IU6M.mjs";
|
||||
import "../../chunk-IHJSPMYM.mjs";
|
||||
import "../../chunk-3GJB4JDF.mjs";
|
||||
export {
|
||||
XMLHttpRequestInterceptor
|
||||
|
|
|
|||
6
node_modules/@mswjs/interceptors/lib/node/interceptors/fetch/index.js
generated
vendored
6
node_modules/@mswjs/interceptors/lib/node/interceptors/fetch/index.js
generated
vendored
|
|
@ -1,12 +1,12 @@
|
|||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
||||
|
||||
var _chunkK4I5GNXUjs = require('../../chunk-K4I5GNXU.js');
|
||||
var _chunkYAIEISARjs = require('../../chunk-YAIEISAR.js');
|
||||
require('../../chunk-PFGO5BSM.js');
|
||||
require('../../chunk-73NOP3T5.js');
|
||||
require('../../chunk-C2JSMMHY.js');
|
||||
require('../../chunk-DLID3GDG.js');
|
||||
require('../../chunk-A7U44ARP.js');
|
||||
require('../../chunk-SMXZPJEA.js');
|
||||
|
||||
|
||||
exports.FetchInterceptor = _chunkK4I5GNXUjs.FetchInterceptor;
|
||||
exports.FetchInterceptor = _chunkYAIEISARjs.FetchInterceptor;
|
||||
//# sourceMappingURL=index.js.map
|
||||
4
node_modules/@mswjs/interceptors/lib/node/interceptors/fetch/index.mjs
generated
vendored
4
node_modules/@mswjs/interceptors/lib/node/interceptors/fetch/index.mjs
generated
vendored
|
|
@ -1,10 +1,10 @@
|
|||
import {
|
||||
FetchInterceptor
|
||||
} from "../../chunk-3TXENUZY.mjs";
|
||||
} from "../../chunk-GL6JCI7E.mjs";
|
||||
import "../../chunk-TX5GBTFY.mjs";
|
||||
import "../../chunk-6YM4PLBI.mjs";
|
||||
import "../../chunk-LGXJ3UUF.mjs";
|
||||
import "../../chunk-YM42IU6M.mjs";
|
||||
import "../../chunk-IHJSPMYM.mjs";
|
||||
import "../../chunk-3GJB4JDF.mjs";
|
||||
export {
|
||||
FetchInterceptor
|
||||
|
|
|
|||
14
node_modules/@mswjs/interceptors/lib/node/presets/node.js
generated
vendored
14
node_modules/@mswjs/interceptors/lib/node/presets/node.js
generated
vendored
|
|
@ -1,25 +1,25 @@
|
|||
"use strict";Object.defineProperty(exports, "__esModule", {value: true});
|
||||
|
||||
var _chunkRA7KLLRDjs = require('../chunk-RA7KLLRD.js');
|
||||
var _chunkZAIODWHAjs = require('../chunk-ZAIODWHA.js');
|
||||
require('../chunk-4YBV77DG.js');
|
||||
|
||||
|
||||
var _chunkR7MWIVYWjs = require('../chunk-R7MWIVYW.js');
|
||||
var _chunk4WG2AM2Tjs = require('../chunk-4WG2AM2T.js');
|
||||
require('../chunk-LK6DILFK.js');
|
||||
|
||||
|
||||
var _chunkK4I5GNXUjs = require('../chunk-K4I5GNXU.js');
|
||||
var _chunkYAIEISARjs = require('../chunk-YAIEISAR.js');
|
||||
require('../chunk-PFGO5BSM.js');
|
||||
require('../chunk-73NOP3T5.js');
|
||||
require('../chunk-C2JSMMHY.js');
|
||||
require('../chunk-DLID3GDG.js');
|
||||
require('../chunk-A7U44ARP.js');
|
||||
require('../chunk-SMXZPJEA.js');
|
||||
|
||||
// src/presets/node.ts
|
||||
var node_default = [
|
||||
new (0, _chunkRA7KLLRDjs.ClientRequestInterceptor)(),
|
||||
new (0, _chunkR7MWIVYWjs.XMLHttpRequestInterceptor)(),
|
||||
new (0, _chunkK4I5GNXUjs.FetchInterceptor)()
|
||||
new (0, _chunkZAIODWHAjs.ClientRequestInterceptor)(),
|
||||
new (0, _chunk4WG2AM2Tjs.XMLHttpRequestInterceptor)(),
|
||||
new (0, _chunkYAIEISARjs.FetchInterceptor)()
|
||||
];
|
||||
|
||||
|
||||
|
|
|
|||
8
node_modules/@mswjs/interceptors/lib/node/presets/node.mjs
generated
vendored
8
node_modules/@mswjs/interceptors/lib/node/presets/node.mjs
generated
vendored
|
|
@ -1,18 +1,18 @@
|
|||
import {
|
||||
ClientRequestInterceptor
|
||||
} from "../chunk-FHLAZ57F.mjs";
|
||||
} from "../chunk-GLGFOTGJ.mjs";
|
||||
import "../chunk-TJDMZZXE.mjs";
|
||||
import {
|
||||
XMLHttpRequestInterceptor
|
||||
} from "../chunk-3HLZLASJ.mjs";
|
||||
} from "../chunk-EADPZWWI.mjs";
|
||||
import "../chunk-6HYIRFX2.mjs";
|
||||
import {
|
||||
FetchInterceptor
|
||||
} from "../chunk-3TXENUZY.mjs";
|
||||
} from "../chunk-GL6JCI7E.mjs";
|
||||
import "../chunk-TX5GBTFY.mjs";
|
||||
import "../chunk-6YM4PLBI.mjs";
|
||||
import "../chunk-LGXJ3UUF.mjs";
|
||||
import "../chunk-YM42IU6M.mjs";
|
||||
import "../chunk-IHJSPMYM.mjs";
|
||||
import "../chunk-3GJB4JDF.mjs";
|
||||
|
||||
// src/presets/node.ts
|
||||
|
|
|
|||
4
node_modules/@mswjs/interceptors/package.json
generated
vendored
4
node_modules/@mswjs/interceptors/package.json
generated
vendored
|
|
@ -1,7 +1,7 @@
|
|||
{
|
||||
"name": "@mswjs/interceptors",
|
||||
"description": "Low-level HTTP/HTTPS/XHR/fetch request interception library.",
|
||||
"version": "0.38.5",
|
||||
"version": "0.38.7",
|
||||
"main": "./lib/node/index.js",
|
||||
"module": "./lib/node/index.mjs",
|
||||
"types": "./lib/node/index.d.ts",
|
||||
|
|
@ -148,6 +148,7 @@
|
|||
"follow-redirects": "^1.15.1",
|
||||
"got": "^14.4.6",
|
||||
"happy-dom": "^17.3.0",
|
||||
"jsdom": "^26.1.0",
|
||||
"node-fetch": "3.3.2",
|
||||
"rimraf": "^6.0.1",
|
||||
"simple-git-hooks": "^2.7.0",
|
||||
|
|
@ -171,7 +172,6 @@
|
|||
"@open-draft/logger": "^0.3.0",
|
||||
"@open-draft/until": "^2.0.0",
|
||||
"is-node-process": "^1.2.0",
|
||||
"jsdom": "^26.0.0",
|
||||
"outvariant": "^1.4.3",
|
||||
"strict-event-emitter": "^0.5.1"
|
||||
},
|
||||
|
|
|
|||
14
node_modules/@mswjs/interceptors/src/interceptors/ClientRequest/MockHttpSocket.ts
generated
vendored
14
node_modules/@mswjs/interceptors/src/interceptors/ClientRequest/MockHttpSocket.ts
generated
vendored
|
|
@ -181,6 +181,20 @@ export class MockHttpSocket extends MockSocket {
|
|||
const socket = this.createConnection()
|
||||
this.originalSocket = socket
|
||||
|
||||
/**
|
||||
* @note Inherit the original socket's connection handle.
|
||||
* Without this, each push to the mock socket results in a
|
||||
* new "connection" listener being added (i.e. buffering pushes).
|
||||
* @see https://github.com/nodejs/node/blob/b18153598b25485ce4f54d0c5cb830a9457691ee/lib/net.js#L734
|
||||
*/
|
||||
if ('_handle' in socket) {
|
||||
Object.defineProperty(this, '_handle', {
|
||||
value: socket._handle,
|
||||
enumerable: true,
|
||||
writable: true,
|
||||
})
|
||||
}
|
||||
|
||||
// If the developer destroys the socket, destroy the original connection.
|
||||
this.once('error', (error) => {
|
||||
socket.destroy(error)
|
||||
|
|
|
|||
29
node_modules/@mswjs/interceptors/src/interceptors/ClientRequest/index.ts
generated
vendored
29
node_modules/@mswjs/interceptors/src/interceptors/ClientRequest/index.ts
generated
vendored
|
|
@ -25,12 +25,37 @@ export class ClientRequestInterceptor extends Interceptor<HttpRequestEventMap> {
|
|||
}
|
||||
|
||||
protected setup(): void {
|
||||
const { get: originalGet, request: originalRequest } = http
|
||||
const {
|
||||
ClientRequest: OriginalClientRequest,
|
||||
get: originalGet,
|
||||
request: originalRequest,
|
||||
} = http
|
||||
const { get: originalHttpsGet, request: originalHttpsRequest } = https
|
||||
|
||||
const onRequest = this.onRequest.bind(this)
|
||||
const onResponse = this.onResponse.bind(this)
|
||||
|
||||
// Support requests performed via the `ClientRequest` constructor directly.
|
||||
http.ClientRequest = new Proxy(http.ClientRequest, {
|
||||
construct: (target, args: Parameters<typeof http.request>) => {
|
||||
const [url, options, callback] = normalizeClientRequestArgs(
|
||||
'http:',
|
||||
args
|
||||
)
|
||||
|
||||
// Create a mock agent instance appropriate for the request protocol.
|
||||
const Agent = options.protocol === 'https:' ? MockHttpsAgent : MockAgent
|
||||
const mockAgent = new Agent({
|
||||
customAgent: options.agent,
|
||||
onRequest,
|
||||
onResponse,
|
||||
})
|
||||
options.agent = mockAgent
|
||||
|
||||
return Reflect.construct(target, [url, options, callback])
|
||||
},
|
||||
})
|
||||
|
||||
http.request = new Proxy(http.request, {
|
||||
apply: (target, thisArg, args: Parameters<typeof http.request>) => {
|
||||
const [url, options, callback] = normalizeClientRequestArgs(
|
||||
|
|
@ -112,6 +137,8 @@ export class ClientRequestInterceptor extends Interceptor<HttpRequestEventMap> {
|
|||
recordRawFetchHeaders()
|
||||
|
||||
this.subscriptions.push(() => {
|
||||
http.ClientRequest = OriginalClientRequest
|
||||
|
||||
http.get = originalGet
|
||||
http.request = originalRequest
|
||||
|
||||
|
|
|
|||
3
node_modules/@mswjs/interceptors/src/utils/fetchUtils.ts
generated
vendored
3
node_modules/@mswjs/interceptors/src/utils/fetchUtils.ts
generated
vendored
|
|
@ -90,8 +90,9 @@ export class FetchResponse extends Response {
|
|||
const finalBody = FetchResponse.isResponseWithBody(status) ? body : null
|
||||
|
||||
super(finalBody, {
|
||||
...init,
|
||||
status: safeStatus,
|
||||
statusText: init.statusText,
|
||||
headers: init.headers,
|
||||
})
|
||||
|
||||
if (status !== safeStatus) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue