@@ -6088,7 +6088,7 @@ var require_formdata = __commonJS({
60886088 type: value.type,
60896089 lastModified: value.lastModified
60906090 };
6091- value = value instanceof File ? new File([value], filename, options) : new FileLike(value, filename, options);
6091+ value = NativeFile && value instanceof NativeFile || value instanceof UndiciFile ? new File([value], filename, options) : new FileLike(value, filename, options);
60926092 }
60936093 }
60946094 return { name, value };
@@ -7505,7 +7505,7 @@ var require_request2 = __commonJS({
75057505 this.origin = origin;
75067506 this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
75077507 this.blocking = blocking == null ? false : blocking;
7508- this.reset = reset == null ? false : reset;
7508+ this.reset = reset == null ? null : reset;
75097509 this.host = null;
75107510 this.contentLength = null;
75117511 this.contentType = null;
@@ -8869,6 +8869,7 @@ var require_client = __commonJS({
88698869 this.bytesRead = 0;
88708870 this.keepAlive = "";
88718871 this.contentLength = "";
8872+ this.connection = "";
88728873 this.maxResponseSize = client[kMaxResponseSize];
88738874 }
88748875 setTimeout(value, type) {
@@ -9004,6 +9005,8 @@ var require_client = __commonJS({
90049005 const key = this.headers[len - 2];
90059006 if (key.length === 10 && key.toString().toLowerCase() === "keep-alive") {
90069007 this.keepAlive += buf.toString();
9008+ } else if (key.length === 10 && key.toString().toLowerCase() === "connection") {
9009+ this.connection += buf.toString();
90079010 } else if (key.length === 14 && key.toString().toLowerCase() === "content-length") {
90089011 this.contentLength += buf.toString();
90099012 }
@@ -9067,7 +9070,7 @@ var require_client = __commonJS({
90679070 }
90689071 assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS);
90699072 this.statusCode = statusCode;
9070- this.shouldKeepAlive = shouldKeepAlive;
9073+ this.shouldKeepAlive = shouldKeepAlive || request.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive" ;
90719074 if (this.statusCode >= 200) {
90729075 const bodyTimeout = request.bodyTimeout != null ? request.bodyTimeout : client[kBodyTimeout];
90739076 this.setTimeout(bodyTimeout, TIMEOUT_BODY);
@@ -9089,7 +9092,7 @@ var require_client = __commonJS({
90899092 assert(this.headers.length % 2 === 0);
90909093 this.headers = [];
90919094 this.headersSize = 0;
9092- if (shouldKeepAlive && client[kPipelining]) {
9095+ if (this. shouldKeepAlive && client[kPipelining]) {
90939096 const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null;
90949097 if (keepAliveTimeout != null) {
90959098 const timeout = Math.min(keepAliveTimeout - client[kKeepAliveTimeoutThreshold], client[kKeepAliveMaxTimeout]);
@@ -9112,7 +9115,6 @@ var require_client = __commonJS({
91129115 return -1;
91139116 }
91149117 if (request.method === "HEAD") {
9115- assert(socket[kReset]);
91169118 return 1;
91179119 }
91189120 if (statusCode < 200) {
@@ -9168,6 +9170,7 @@ var require_client = __commonJS({
91689170 this.bytesRead = 0;
91699171 this.contentLength = "";
91709172 this.keepAlive = "";
9173+ this.connection = "";
91719174 assert(this.headers.length % 2 === 0);
91729175 this.headers = [];
91739176 this.headersSize = 0;
@@ -9534,8 +9537,8 @@ var require_client = __commonJS({
95349537 if (upgrade || method === "CONNECT") {
95359538 socket[kReset] = true;
95369539 }
9537- if (reset) {
9538- socket[kReset] = true ;
9540+ if (reset != null ) {
9541+ socket[kReset] = reset ;
95399542 }
95409543 if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
95419544 socket[kReset] = true;
@@ -14518,18 +14521,12 @@ var require_websocket = __commonJS({
1451814521 this.#bufferedAmount -= value.byteLength;
1451914522 });
1452014523 } else if (ArrayBuffer.isView(data)) {
14521- const ab = new ArrayBuffer(data.byteLength);
14522- if (Buffer.isBuffer(data)) {
14523- Buffer.from(ab).set(data);
14524- } else {
14525- new data.constructor(ab).set(data);
14526- }
14527- const value = Buffer.from(ab);
14528- const frame = new WebsocketFrameSend(value);
14524+ const ab = Buffer.from(data, data.byteOffset, data.byteLength);
14525+ const frame = new WebsocketFrameSend(ab);
1452914526 const buffer = frame.createFrame(opcodes.BINARY);
14530- this.#bufferedAmount += value .byteLength;
14527+ this.#bufferedAmount += ab .byteLength;
1453114528 socket.write(buffer, () => {
14532- this.#bufferedAmount -= value .byteLength;
14529+ this.#bufferedAmount -= ab .byteLength;
1453314530 });
1453414531 } else if (isBlobLike(data)) {
1453514532 const frame = new WebsocketFrameSend();
0 commit comments