aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/http.exports.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/http.exports.js')
-rw-r--r--src/bun.js/http.exports.js8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/bun.js/http.exports.js b/src/bun.js/http.exports.js
index a7f67f0e9..d21f768d4 100644
--- a/src/bun.js/http.exports.js
+++ b/src/bun.js/http.exports.js
@@ -959,10 +959,14 @@ export class ClientRequest extends OutgoingMessage {
if (this.#signal?.aborted) {
this[kAbortController].abort();
}
+
+ var method = this.#method,
+ body = this.#body;
+
this.#fetchRequest = fetch(`${this.#protocol}//${this.#host}:${this.#port}${this.#path}`, {
- method: this.#method,
+ method,
headers: this.getHeaders(),
- body: this.#body || undefined,
+ body: body && method !== "GET" && method !== "HEAD" && method !== "OPTIONS" ? body : undefined,
redirect: "manual",
verbose: Boolean(__DEBUG__),
signal: this[kAbortController].signal,