@@ -6088,7 +6088,7 @@ var require_formdata = __commonJS({
6088
6088
type: value.type,
6089
6089
lastModified: value.lastModified
6090
6090
};
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);
6092
6092
}
6093
6093
}
6094
6094
return { name, value };
@@ -7505,7 +7505,7 @@ var require_request2 = __commonJS({
7505
7505
this.origin = origin;
7506
7506
this.idempotent = idempotent == null ? method === "HEAD" || method === "GET" : idempotent;
7507
7507
this.blocking = blocking == null ? false : blocking;
7508
- this.reset = reset == null ? false : reset;
7508
+ this.reset = reset == null ? null : reset;
7509
7509
this.host = null;
7510
7510
this.contentLength = null;
7511
7511
this.contentType = null;
@@ -8869,6 +8869,7 @@ var require_client = __commonJS({
8869
8869
this.bytesRead = 0;
8870
8870
this.keepAlive = "";
8871
8871
this.contentLength = "";
8872
+ this.connection = "";
8872
8873
this.maxResponseSize = client[kMaxResponseSize];
8873
8874
}
8874
8875
setTimeout(value, type) {
@@ -9004,6 +9005,8 @@ var require_client = __commonJS({
9004
9005
const key = this.headers[len - 2];
9005
9006
if (key.length === 10 && key.toString().toLowerCase() === "keep-alive") {
9006
9007
this.keepAlive += buf.toString();
9008
+ } else if (key.length === 10 && key.toString().toLowerCase() === "connection") {
9009
+ this.connection += buf.toString();
9007
9010
} else if (key.length === 14 && key.toString().toLowerCase() === "content-length") {
9008
9011
this.contentLength += buf.toString();
9009
9012
}
@@ -9067,7 +9070,7 @@ var require_client = __commonJS({
9067
9070
}
9068
9071
assert.strictEqual(this.timeoutType, TIMEOUT_HEADERS);
9069
9072
this.statusCode = statusCode;
9070
- this.shouldKeepAlive = shouldKeepAlive;
9073
+ this.shouldKeepAlive = shouldKeepAlive || request.method === "HEAD" && !socket[kReset] && this.connection.toLowerCase() === "keep-alive" ;
9071
9074
if (this.statusCode >= 200) {
9072
9075
const bodyTimeout = request.bodyTimeout != null ? request.bodyTimeout : client[kBodyTimeout];
9073
9076
this.setTimeout(bodyTimeout, TIMEOUT_BODY);
@@ -9089,7 +9092,7 @@ var require_client = __commonJS({
9089
9092
assert(this.headers.length % 2 === 0);
9090
9093
this.headers = [];
9091
9094
this.headersSize = 0;
9092
- if (shouldKeepAlive && client[kPipelining]) {
9095
+ if (this. shouldKeepAlive && client[kPipelining]) {
9093
9096
const keepAliveTimeout = this.keepAlive ? util.parseKeepAliveTimeout(this.keepAlive) : null;
9094
9097
if (keepAliveTimeout != null) {
9095
9098
const timeout = Math.min(keepAliveTimeout - client[kKeepAliveTimeoutThreshold], client[kKeepAliveMaxTimeout]);
@@ -9112,7 +9115,6 @@ var require_client = __commonJS({
9112
9115
return -1;
9113
9116
}
9114
9117
if (request.method === "HEAD") {
9115
- assert(socket[kReset]);
9116
9118
return 1;
9117
9119
}
9118
9120
if (statusCode < 200) {
@@ -9168,6 +9170,7 @@ var require_client = __commonJS({
9168
9170
this.bytesRead = 0;
9169
9171
this.contentLength = "";
9170
9172
this.keepAlive = "";
9173
+ this.connection = "";
9171
9174
assert(this.headers.length % 2 === 0);
9172
9175
this.headers = [];
9173
9176
this.headersSize = 0;
@@ -9534,8 +9537,8 @@ var require_client = __commonJS({
9534
9537
if (upgrade || method === "CONNECT") {
9535
9538
socket[kReset] = true;
9536
9539
}
9537
- if (reset) {
9538
- socket[kReset] = true ;
9540
+ if (reset != null ) {
9541
+ socket[kReset] = reset ;
9539
9542
}
9540
9543
if (client[kMaxRequests] && socket[kCounter]++ >= client[kMaxRequests]) {
9541
9544
socket[kReset] = true;
@@ -14518,18 +14521,12 @@ var require_websocket = __commonJS({
14518
14521
this.#bufferedAmount -= value.byteLength;
14519
14522
});
14520
14523
} 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);
14529
14526
const buffer = frame.createFrame(opcodes.BINARY);
14530
- this.#bufferedAmount += value .byteLength;
14527
+ this.#bufferedAmount += ab .byteLength;
14531
14528
socket.write(buffer, () => {
14532
- this.#bufferedAmount -= value .byteLength;
14529
+ this.#bufferedAmount -= ab .byteLength;
14533
14530
});
14534
14531
} else if (isBlobLike(data)) {
14535
14532
const frame = new WebsocketFrameSend();
0 commit comments