-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ServerResponse#appendHeader not implemented #19993
Comments
Temporary workaround (forces const oldSet = Headers.prototype.set;
Headers.prototype.set = function set(
this: Headers,
key: string,
value: string | string[]
) {
if (Array.isArray(value)) {
this.delete(key);
value.forEach((v) => this.append(key, v));
} else {
oldSet.call(this, key, value);
}
}; |
@cyco130 do you have some reproduction code? We have this method implemented here: deno/ext/node/polyfills/_http_outgoing.ts Line 257 in 02865cb
|
The problem is that Reproduction is simply: import { ServerResponse } from "node:http";
console.assert(typeof new ServerResponse({}).appendHeader === "function"); |
Ah, good catch! Thanks for pointing this out. |
The
appendHeader
method ofServerResponse
from thenode:http
module doesn't seem to have been implemented. This makes it impossible to return multipleSet-Cookie
headers from the server when usingnode:http
(I tried a few other ways like passing an array tosetHeader
or callingwriteHead
with an array value forset-cookie
but none seemed to work).System Info
The text was updated successfully, but these errors were encountered: