@whatwg-node/node-fetch 0.7.20-alpha-20250515134817-51db29f9612b508f027ee304f02356f5e6961501 → 0.7.20-alpha-20250515151955-4c8a2213bcb37b6a17a931105ffadb83226f5099

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/cjs/Headers.js CHANGED
@@ -67,7 +67,7 @@ class PonyfillHeaders {
67
67
  // I could do a getter here, but I'm too lazy to type `getter`.
68
68
  getMap() {
69
69
  if (!this._map) {
70
- this._setCookies = [];
70
+ this._setCookies ||= [];
71
71
  if (this.headersInit != null) {
72
72
  if ((0, utils_js_1.isArray)(this.headersInit)) {
73
73
  this._map = new Map();
@@ -132,7 +132,8 @@ class PonyfillHeaders {
132
132
  return value.toString();
133
133
  }
134
134
  has(name) {
135
- if (name === 'set-cookie') {
135
+ const key = name.toLowerCase();
136
+ if (key === 'set-cookie') {
136
137
  return !!this._setCookies?.length;
137
138
  }
138
139
  return !!this._get(name); // we might need to check if header exists and not just check if it's not nullable
package/esm/Headers.js CHANGED
@@ -63,7 +63,7 @@ export class PonyfillHeaders {
63
63
  // I could do a getter here, but I'm too lazy to type `getter`.
64
64
  getMap() {
65
65
  if (!this._map) {
66
- this._setCookies = [];
66
+ this._setCookies ||= [];
67
67
  if (this.headersInit != null) {
68
68
  if (isArray(this.headersInit)) {
69
69
  this._map = new Map();
@@ -128,7 +128,8 @@ export class PonyfillHeaders {
128
128
  return value.toString();
129
129
  }
130
130
  has(name) {
131
- if (name === 'set-cookie') {
131
+ const key = name.toLowerCase();
132
+ if (key === 'set-cookie') {
132
133
  return !!this._setCookies?.length;
133
134
  }
134
135
  return !!this._get(name); // we might need to check if header exists and not just check if it's not nullable
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@whatwg-node/node-fetch",
3
- "version": "0.7.20-alpha-20250515134817-51db29f9612b508f027ee304f02356f5e6961501",
3
+ "version": "0.7.20-alpha-20250515151955-4c8a2213bcb37b6a17a931105ffadb83226f5099",
4
4
  "description": "Fetch API implementation for Node",
5
5
  "sideEffects": false,
6
6
  "dependencies": {