| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 0bf8952 commit d86a118
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -673,20 +673,22 @@ OutgoingMessage.prototype.setHeaders = function setHeaders(headers) { | |||
| 673 | 673 | // We also cannot safely split by comma. | |
| 674 | 674 | // To avoid setHeader overwriting the previous value we push | |
| 675 | 675 | // set-cookie values in array and set them all at once. | |
| 676 | - const cookies = []; | ||
| 676 | + let cookies = null; | ||
| 677 | 677 | ||
| 678 | 678 | for (const { 0: key, 1: value } of headers) { | |
| 679 | 679 | if (key === 'set-cookie') { | |
| 680 | 680 | if (ArrayIsArray(value)) { | |
| 681 | + cookies ??= []; | ||
| 681 | 682 | cookies.push(...value); | |
| 682 | 683 | } else { | |
| 684 | + cookies ??= []; | ||
| 683 | 685 | cookies.push(value); | |
| 684 | 686 | } | |
| 685 | 687 | continue; | |
| 686 | 688 | } | |
| 687 | 689 | this.setHeader(key, value); | |
| 688 | 690 | } | |
| 689 | - if (cookies.length) { | ||
| 691 | + if (cookies != null) { | ||
| 690 | 692 | this.setHeader('set-cookie', cookies); | |
| 691 | 693 | } | |
| 692 | 694 | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments