MIRROR: javascript for ๐Ÿœ's, a tiny runtime with big ambitions
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add appendHeader

+15
+15
src/builtins/node/http.mjs
··· 235 235 return this._headers[normalizeHeaderName(name)] !== undefined; 236 236 } 237 237 238 + appendHeader(name, value) { 239 + const key = normalizeHeaderName(name); 240 + const existing = this._headers[key]; 241 + if (existing === undefined) { 242 + this._headers[key] = value; 243 + } else if (Array.isArray(existing)) { 244 + if (Array.isArray(value)) existing.push(...value); 245 + else existing.push(value); 246 + } else { 247 + this._headers[key] = Array.isArray(value) ? [existing, ...value] : [existing, value]; 248 + } 249 + if (!this._headerNames[key]) this._headerNames[key] = String(name); 250 + return this; 251 + } 252 + 238 253 removeHeader(name) { 239 254 const key = normalizeHeaderName(name); 240 255 delete this._headers[key];