From 56e8ed5eb1a6f2880c96fc8f08e35a6dd83aad8b Mon Sep 17 00:00:00 2001 From: Luca Casonato Date: Mon, 12 Aug 2024 12:01:37 +0200 Subject: fix(ext/node): don't concat set-cookie in ServerResponse.appendHeader (#25000) Follow-on to https://github.com/denoland/deno/pull/24216/files#r1642188672 --- ext/node/polyfills/http.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'ext/node') 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]]; } -- cgit v1.2.3