Commit 8103a78
http2: add strictSingleValueFields option to relax header validation
Previously it was impossible to send multiple values for any header
or trailer defined officially as supporting only a single value.
This is a good default, but in practice many of these headers are used
in weird & wonderful ways where this can be problematic. This new
option allows for relaxing this restriction to support those cases
where required.
This option defaults to true so validation will still be applied
as before, rejecting multiple single-value fields, unless explicitly
disabled.
PR-URL: #59917
Reviewed-By: Stephen Belanger <admin@stephenbelanger.com>1 parent ee59127 commit 8103a78Copy full SHA for 8103a78
8 files changed
+208-44Lines changed: 208 additions & 44 deletions
File tree
Expand file treeCollapse file tree
Open diff view settings
Filter options
- doc/api
- lib/internal
- http2
- quic
- test/parallel
Expand file treeCollapse file tree
Open diff view settings
Collapse file
+14Lines changed: 14 additions & 0 deletions
- Display the source diff
- Display the rich diff
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
2793 | 2793 | |
2794 | 2794 | |
2795 | 2795 | |
| 2796 | + |
| 2797 | + |
| 2798 | + |
2796 | 2799 | |
2797 | 2800 | |
2798 | 2801 | |
| ||
2952 | 2955 | |
2953 | 2956 | |
2954 | 2957 | |
| 2958 | + |
| 2959 | + |
| 2960 | + |
| 2961 | + |
2955 | 2962 | |
2956 | 2963 | |
2957 | 2964 | |
| ||
3009 | 3016 | |
3010 | 3017 | |
3011 | 3018 | |
| 3019 | + |
| 3020 | + |
| 3021 | + |
3012 | 3022 | |
3013 | 3023 | |
3014 | 3024 | |
| ||
3130 | 3140 | |
3131 | 3141 | |
3132 | 3142 | |
| 3143 | + |
| 3144 | + |
| 3145 | + |
| 3146 | + |
3133 | 3147 | |
3134 | 3148 | |
3135 | 3149 | |
|
Collapse file
+50-8Lines changed: 50 additions & 8 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
136 | 136 | |
137 | 137 | |
138 | 138 | |
| 139 | + |
139 | 140 | |
140 | 141 | |
141 | 142 | |
| ||
148 | 149 | |
149 | 150 | |
150 | 151 | |
| 152 | + |
151 | 153 | |
152 | 154 | |
153 | 155 | |
| ||
1318 | 1320 | |
1319 | 1321 | |
1320 | 1322 | |
| 1323 | + |
| 1324 | + |
1321 | 1325 | |
1322 | 1326 | |
1323 | 1327 | |
| ||
2370 | 2374 | |
2371 | 2375 | |
2372 | 2376 | |
2373 | | - |
| 2377 | + |
| 2378 | + |
| 2379 | + |
| 2380 | + |
| 2381 | + |
2374 | 2382 | |
2375 | 2383 | |
2376 | 2384 | |
| ||
2579 | 2587 | |
2580 | 2588 | |
2581 | 2589 | |
2582 | | - |
| 2590 | + |
| 2591 | + |
| 2592 | + |
| 2593 | + |
| 2594 | + |
2583 | 2595 | |
2584 | 2596 | |
2585 | 2597 | |
| ||
2682 | 2694 | |
2683 | 2695 | |
2684 | 2696 | |
2685 | | - |
| 2697 | + |
| 2698 | + |
| 2699 | + |
| 2700 | + |
| 2701 | + |
2686 | 2702 | |
2687 | 2703 | |
2688 | 2704 | |
| ||
2909 | 2925 | |
2910 | 2926 | |
2911 | 2927 | |
2912 | | - |
| 2928 | + |
| 2929 | + |
| 2930 | + |
| 2931 | + |
| 2932 | + |
2913 | 2933 | |
2914 | 2934 | |
2915 | 2935 | |
| ||
3173 | 3193 | |
3174 | 3194 | |
3175 | 3195 | |
3176 | | - |
| 3196 | + |
| 3197 | + |
| 3198 | + |
| 3199 | + |
| 3200 | + |
3177 | 3201 | |
3178 | 3202 | |
3179 | 3203 | |
| ||
3326 | 3350 | |
3327 | 3351 | |
3328 | 3352 | |
3329 | | - |
| 3353 | + |
3330 | 3354 | |
3331 | 3355 | |
3332 | 3356 | |
3333 | 3357 | |
3334 | | - |
| 3358 | + |
3335 | 3359 | |
3336 | 3360 | |
3337 | 3361 | |
3338 | 3362 | |
3339 | | - |
| 3363 | + |
3340 | 3364 | |
3341 | 3365 | |
3342 | 3366 | |
3343 | 3367 | |
| 3368 | + |
| 3369 | + |
| 3370 | + |
| 3371 | + |
| 3372 | + |
| 3373 | + |
| 3374 | + |
| 3375 | + |
| 3376 | + |
3344 | 3377 | |
3345 | 3378 | |
3346 | 3379 | |
| ||
3553 | 3586 | |
3554 | 3587 | |
3555 | 3588 | |
| 3589 | + |
| 3590 | + |
| 3591 | + |
| 3592 | + |
| 3593 | + |
| 3594 | + |
| 3595 | + |
| 3596 | + |
| 3597 | + |
3556 | 3598 | |
3557 | 3599 | |
3558 | 3600 | |
|
Collapse file
+21-8Lines changed: 21 additions & 8 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
39 | 39 | |
40 | 40 | |
41 | 41 | |
| 42 | + |
42 | 43 | |
43 | 44 | |
44 | 45 | |
| ||
121 | 122 | |
122 | 123 | |
123 | 124 | |
124 | | - |
| 125 | + |
125 | 126 | |
126 | 127 | |
127 | 128 | |
| ||
690 | 691 | |
691 | 692 | |
692 | 693 | |
| 694 | + |
693 | 695 | |
694 | 696 | |
695 | 697 | |
| ||
731 | 733 | |
732 | 734 | |
733 | 735 | |
734 | | - |
| 736 | + |
| 737 | + |
| 738 | + |
| 739 | + |
| 740 | + |
735 | 741 | |
736 | 742 | |
737 | 743 | |
| ||
751 | 757 | |
752 | 758 | |
753 | 759 | |
| 760 | + |
| 761 | + |
| 762 | + |
| 763 | + |
754 | 764 | |
755 | 765 | |
756 | 766 | |
757 | | - |
| 767 | + |
| 768 | + |
758 | 769 | |
759 | 770 | |
760 | 771 | |
| ||
765 | 776 | |
766 | 777 | |
767 | 778 | |
768 | | - |
| 779 | + |
| 780 | + |
769 | 781 | |
770 | 782 | |
771 | 783 | |
| ||
776 | 788 | |
777 | 789 | |
778 | 790 | |
779 | | - |
| 791 | + |
780 | 792 | |
781 | 793 | |
782 | 794 | |
783 | 795 | |
784 | 796 | |
785 | | - |
| 797 | + |
786 | 798 | |
787 | 799 | |
788 | 800 | |
| ||
791 | 803 | |
792 | 804 | |
793 | 805 | |
794 | | - |
| 806 | + |
795 | 807 | |
796 | 808 | |
797 | 809 | |
| ||
893 | 905 | |
894 | 906 | |
895 | 907 | |
896 | | - |
| 908 | + |
897 | 909 | |
898 | 910 | |
899 | 911 | |
| ||
970 | 982 | |
971 | 983 | |
972 | 984 | |
| 985 | + |
973 | 986 | |
974 | 987 | |
975 | 988 | |
|
Collapse file
+7-1Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
112 | 112 | |
113 | 113 | |
114 | 114 | |
| 115 | + |
115 | 116 | |
116 | 117 | |
117 | 118 | |
| ||
887 | 888 | |
888 | 889 | |
889 | 890 | |
| 891 | + |
| 892 | + |
| 893 | + |
| 894 | + |
| 895 | + |
890 | 896 | |
891 | | - |
| 897 | + |
892 | 898 | |
893 | 899 | |
894 | 900 | |
|
Collapse file
test/parallel/test-http2-single-headers-validation-disabled.js
Copy file name to clipboard+53Lines changed: 53 additions & 0 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
| 1 | + |
| 2 | + |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | + |
| 8 | + |
| 9 | + |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
| 15 | + |
| 16 | + |
| 17 | + |
| 18 | + |
| 19 | + |
| 20 | + |
| 21 | + |
| 22 | + |
| 23 | + |
| 24 | + |
| 25 | + |
| 26 | + |
| 27 | + |
| 28 | + |
| 29 | + |
| 30 | + |
| 31 | + |
| 32 | + |
| 33 | + |
| 34 | + |
| 35 | + |
| 36 | + |
| 37 | + |
| 38 | + |
| 39 | + |
| 40 | + |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + |
| 45 | + |
| 46 | + |
| 47 | + |
| 48 | + |
| 49 | + |
| 50 | + |
| 51 | + |
| 52 | + |
| 53 | + |
Collapse file
…st/parallel/test-http2-single-headers.js …/test-http2-single-headers-validation.jstest/parallel/test-http2-single-headers.js renamed to test/parallel/test-http2-single-headers-validation.js test/parallel/test-http2-single-headers.js renamed to test/parallel/test-http2-single-headers-validation.js
Copy file name to clipboardFile renamed without changes.
Collapse file
test/parallel/test-http2-util-assert-valid-pseudoheader.js
Copy file name to clipboardExpand all lines: test/parallel/test-http2-util-assert-valid-pseudoheader.js+7-11Lines changed: 7 additions & 11 deletions
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| ||
4 | 4 | |
5 | 5 | |
6 | 6 | |
7 | | - |
8 | | - |
9 | | - |
10 | | - |
11 | | - |
| 7 | + |
12 | 8 | |
13 | 9 | |
14 | | - |
15 | | - |
16 | | - |
17 | | - |
18 | | - |
| 10 | + |
| 11 | + |
| 12 | + |
| 13 | + |
| 14 | + |
19 | 15 | |
20 | | - |
| 16 | + |
21 | 17 | |
22 | 18 | |
23 | 19 | |
|
0 commit comments