@whatwg-node/node-fetch 0.0.6-alpha-20230207093213-131f46f → 0.0.6-alpha-20230207114030-349e836
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/index.js +9 -9
- package/index.mjs +9 -9
- package/package.json +1 -1
package/index.js
CHANGED
@@ -729,11 +729,12 @@ class PonyfillHeaders {
|
|
729
729
|
});
|
730
730
|
}
|
731
731
|
else {
|
732
|
-
for (const
|
733
|
-
const
|
734
|
-
if (
|
735
|
-
const normalizedValue = Array.isArray(
|
736
|
-
|
732
|
+
for (const initKey in headersInit) {
|
733
|
+
const initValue = headersInit[initKey];
|
734
|
+
if (initValue != null) {
|
735
|
+
const normalizedValue = Array.isArray(initValue) ? initValue.join(', ') : initValue;
|
736
|
+
const normalizedKey = initKey.toLowerCase();
|
737
|
+
this.map.set(normalizedKey, normalizedValue);
|
737
738
|
}
|
738
739
|
}
|
739
740
|
}
|
@@ -741,10 +742,9 @@ class PonyfillHeaders {
|
|
741
742
|
}
|
742
743
|
append(name, value) {
|
743
744
|
const key = name.toLowerCase();
|
744
|
-
|
745
|
-
|
746
|
-
|
747
|
-
this.map.set(key, value);
|
745
|
+
const existingValue = this.map.get(key);
|
746
|
+
const finalValue = existingValue ? `${existingValue}, ${value}` : value;
|
747
|
+
this.map.set(key, finalValue);
|
748
748
|
}
|
749
749
|
get(name) {
|
750
750
|
const key = name.toLowerCase();
|
package/index.mjs
CHANGED
@@ -723,11 +723,12 @@ class PonyfillHeaders {
|
|
723
723
|
});
|
724
724
|
}
|
725
725
|
else {
|
726
|
-
for (const
|
727
|
-
const
|
728
|
-
if (
|
729
|
-
const normalizedValue = Array.isArray(
|
730
|
-
|
726
|
+
for (const initKey in headersInit) {
|
727
|
+
const initValue = headersInit[initKey];
|
728
|
+
if (initValue != null) {
|
729
|
+
const normalizedValue = Array.isArray(initValue) ? initValue.join(', ') : initValue;
|
730
|
+
const normalizedKey = initKey.toLowerCase();
|
731
|
+
this.map.set(normalizedKey, normalizedValue);
|
731
732
|
}
|
732
733
|
}
|
733
734
|
}
|
@@ -735,10 +736,9 @@ class PonyfillHeaders {
|
|
735
736
|
}
|
736
737
|
append(name, value) {
|
737
738
|
const key = name.toLowerCase();
|
738
|
-
|
739
|
-
|
740
|
-
|
741
|
-
this.map.set(key, value);
|
739
|
+
const existingValue = this.map.get(key);
|
740
|
+
const finalValue = existingValue ? `${existingValue}, ${value}` : value;
|
741
|
+
this.map.set(key, finalValue);
|
742
742
|
}
|
743
743
|
get(name) {
|
744
744
|
const key = name.toLowerCase();
|
package/package.json
CHANGED