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.ts5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts
index e0ddedef8..575c6517e 100644
--- a/ext/node/polyfills/http.ts
+++ b/ext/node/polyfills/http.ts
@@ -1439,12 +1439,11 @@ export class ServerResponse extends NodeWritable {
}
appendHeader(name: string, value: string | string[]) {
- if (Array.isArray(value)) {
- this.#hasNonStringHeaders = true;
- }
if (this.#headers[name] === undefined) {
+ if (Array.isArray(value)) this.#hasNonStringHeaders = true;
this.#headers[name] = value;
} else {
+ this.#hasNonStringHeaders = true;
if (!Array.isArray(this.#headers[name])) {
this.#headers[name] = [this.#headers[name]];
}