From 811017322500a1663f9c71ee5aed4490f07c091e Mon Sep 17 00:00:00 2001 From: Ciro Spaciari Date: Fri, 6 Sep 2024 18:43:30 -0700 Subject: [PATCH] revert this part for now --- src/js/node/http.ts | 56 +-------------------------------------------- 1 file changed, 1 insertion(+), 55 deletions(-) diff --git a/src/js/node/http.ts b/src/js/node/http.ts index c9c5e0a113..0d16e07ace 100644 --- a/src/js/node/http.ts +++ b/src/js/node/http.ts @@ -1798,9 +1798,6 @@ class ClientRequest extends OutgoingMessage { this.#joinDuplicateHeaders = _joinDuplicateHeaders; if (options.pfx) { throw new Error("pfx is not supported"); - } else { - const agentPfx = this.#agent?.pfx; - if (agentPfx) throw new Error("pfx is not supported"); } if (options.rejectUnauthorized !== undefined) this._ensureTls().rejectUnauthorized = options.rejectUnauthorized; @@ -1814,15 +1811,6 @@ class ClientRequest extends OutgoingMessage { "ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile", ); this._ensureTls().ca = options.ca; - } else { - const agentCa = this.#agent?.ca; - if (agentCa) { - if (!isValidTLSArray(agentCa)) - throw new TypeError( - "agent ca argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile", - ); - this._ensureTls().ca = agentCa; - } } if (options.cert) { if (!isValidTLSArray(options.cert)) @@ -1830,73 +1818,31 @@ class ClientRequest extends OutgoingMessage { "cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile", ); this._ensureTls().cert = options.cert; - } else { - const agentCert = this.#agent?.cert; - if (agentCert) { - if (!isValidTLSArray(agentCert)) - throw new TypeError( - "agent cert argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile", - ); - this._ensureTls().cert = agentCert; - } } + å; if (options.key) { if (!isValidTLSArray(options.key)) throw new TypeError( "key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile", ); this._ensureTls().key = options.key; - } else { - const agentKey = this.#agent?.key; - if (agentKey) { - if (!isValidTLSArray(agentKey)) - throw new TypeError( - "agent key argument must be an string, Buffer, TypedArray, BunFile or an array containing string, Buffer, TypedArray or BunFile", - ); - this._ensureTls().key = agentKey; - } } if (options.passphrase) { if (typeof options.passphrase !== "string") throw new TypeError("passphrase argument must be a string"); this._ensureTls().passphrase = options.passphrase; - } else { - const agentPassphrase = this.#agent?.passphrase; - if (agentPassphrase) { - if (typeof agentPassphrase !== "string") throw new TypeError("agent passphrase argument must be a string"); - this._ensureTls().passphrase = agentPassphrase; - } } if (options.ciphers) { if (typeof options.ciphers !== "string") throw new TypeError("ciphers argument must be a string"); this._ensureTls().ciphers = options.ciphers; - } else { - const agentCiphers = this.#agent?.ciphers; - if (agentCiphers) { - if (typeof agentCiphers !== "string") throw new TypeError("agent ciphers argument must be a string"); - this._ensureTls().ciphers = agentCiphers; - } } if (options.servername) { if (typeof options.servername !== "string") throw new TypeError("servername argument must be a string"); this._ensureTls().servername = options.servername; - } else { - const agentServername = this.#agent?.servername; - if (agentServername) { - if (typeof agentServername !== "string") throw new TypeError("agent servername argument must be a string"); - this._ensureTls().servername = agentServername; - } } if (options.secureOptions) { if (typeof options.secureOptions !== "number") throw new TypeError("secureOptions argument must be a string"); this._ensureTls().secureOptions = options.secureOptions; - } else { - const agentSecureOptions = this.#agent?.secureOptions; - if (agentSecureOptions) { - if (typeof agentSecureOptions !== "number") - throw new TypeError("agent secureOptions argument must be a string"); - this._ensureTls().secureOptions = agentSecureOptions; - } } this.#path = options.path || "/"; if (cb) {