summaryrefslogtreecommitdiff
path: root/ext/node/polyfills/http.ts
diff options
context:
space:
mode:
Diffstat (limited to 'ext/node/polyfills/http.ts')
-rw-r--r--ext/node/polyfills/http.ts8
1 files changed, 7 insertions, 1 deletions
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts
index 2d80c2cd9..609a046ac 100644
--- a/ext/node/polyfills/http.ts
+++ b/ext/node/polyfills/http.ts
@@ -55,6 +55,7 @@ import {
import { getTimerDuration } from "ext:deno_node/internal/timers.mjs";
import { serve, upgradeHttpRaw } from "ext:deno_http/00_serve.js";
import { createHttpClient } from "ext:deno_fetch/22_http_client.js";
+import { headersEntries } from "ext:deno_fetch/20_headers.js";
import { timerId } from "ext:deno_web/03_abort_signal.js";
import { clearTimeout as webClearTimeout } from "ext:deno_web/02_timers.js";
import { TcpConn } from "ext:deno_net/01_net.js";
@@ -1486,7 +1487,12 @@ export class IncomingMessageForServer extends NodeReadable {
get headers() {
if (!this.#headers) {
- this.#headers = Object.fromEntries(this.#req.headers.entries());
+ this.#headers = {};
+ const entries = headersEntries(this.#req.headers);
+ for (let i = 0; i < entries.length; i++) {
+ const entry = entries[i];
+ this.#headers[entry[0]] = entry[1];
+ }
}
return this.#headers;
}