diff options
author | Divy Srivastava <dj.srivastava23@gmail.com> | 2023-12-11 11:11:59 +0530 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-11 11:11:59 +0530 |
commit | 5e24e283189ca85868cb45e43584454acccd7159 (patch) | |
tree | fe6162f1a241af0f08019be229e5f6fb9c560da5 /ext/node/polyfills/http.ts | |
parent | e8fc7c20b754514cf99741f630751cc8bb756145 (diff) |
fix(ext/node): ServerResponse getHeader() return undefined (#21525)
Matches Node's return type.
Next.js check for `if (header === undefined)`:
https://github.com/vercel/next.js/blob/e02fe314dcd0ae614c65b505c6daafbdeebb920e/packages/next/src/server/base-http/node.ts#L93
Diffstat (limited to 'ext/node/polyfills/http.ts')
-rw-r--r-- | ext/node/polyfills/http.ts | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ext/node/polyfills/http.ts b/ext/node/polyfills/http.ts index 27fc577c0..d45854162 100644 --- a/ext/node/polyfills/http.ts +++ b/ext/node/polyfills/http.ts @@ -1394,7 +1394,7 @@ export class ServerResponse extends NodeWritable { } getHeader(name: string) { - return this.#headers.get(name); + return this.#headers.get(name) ?? undefined; } removeHeader(name: string) { return this.#headers.delete(name); |