Commit 2688767
authored
feat(gateway): IPIP-523 format query over Accept header (#1074)
* feat(gateway): IPIP-523 format query param takes precedence over Accept header
this change simplifies precedence rules by making the ?format= URL query
parameter always take priority over the Accept HTTP header when both are
present.
in practice, this is largely compatible with existing browser use cases
since browsers send Accept headers with wildcards which were already
treated as non-specific. prioritizing ?format= also ensures deterministic
HTTP caching behavior, protecting against CDNs that comingle different
response types under the same cache key.
the only breaking change is for edge cases where a client sends both a
specific Accept header and a different ?format= value. previously Accept
would win, now ?format= wins. this scenario is rare and arguably
represents client misconfiguration. when detected, gateway returns HTTP
400 to signal the ambiguity.
specs: ipfs/specs#523
tests: ipfs/gateway-conformance#252
* docs(changelog): add IPIP-523 to unreleased
* fix(gateway): IPIP-523 ?format always wins over Accept header
remove HTTP 400 error for conflicting ?format and Accept values.
instead, ?format silently takes precedence, which is simpler and
less breaking for browser clients that send Accept headers automatically.
* ci: use gateway-conformance with IPIP-523 tests
temporary switch to ipfs/gateway-conformance#252
* chore(ci): switch to gateway-conformance@v0.91 parent 63b6a19 commit 2688767
File tree
6 files changed
+98
-31
lines changed- .github/workflows
- gateway
6 files changed
+98
-31
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
| |||
47 | 47 | | |
48 | 48 | | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
| |||
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
87 | | - | |
| 87 | + | |
88 | 88 | | |
89 | 89 | | |
90 | 90 | | |
| |||
114 | 114 | | |
115 | 115 | | |
116 | 116 | | |
117 | | - | |
| 117 | + | |
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
182 | 182 | | |
183 | 183 | | |
184 | 184 | | |
185 | | - | |
| 185 | + | |
186 | 186 | | |
187 | 187 | | |
188 | 188 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
21 | 23 | | |
22 | 24 | | |
23 | 25 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
575 | 575 | | |
576 | 576 | | |
577 | 577 | | |
578 | | - | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
579 | 602 | | |
580 | 603 | | |
581 | 604 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
666 | 666 | | |
667 | 667 | | |
668 | 668 | | |
669 | | - | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
670 | 680 | | |
671 | | - | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
672 | 691 | | |
673 | 692 | | |
674 | 693 | | |
675 | 694 | | |
676 | 695 | | |
677 | 696 | | |
| 697 | + | |
| 698 | + | |
678 | 699 | | |
679 | 700 | | |
680 | 701 | | |
| |||
688 | 709 | | |
689 | 710 | | |
690 | 711 | | |
691 | | - | |
| 712 | + | |
| 713 | + | |
| 714 | + | |
692 | 715 | | |
693 | 716 | | |
| 717 | + | |
| 718 | + | |
| 719 | + | |
694 | 720 | | |
695 | 721 | | |
696 | | - | |
697 | | - | |
698 | | - | |
699 | | - | |
| 722 | + | |
| 723 | + | |
| 724 | + | |
| 725 | + | |
| 726 | + | |
| 727 | + | |
700 | 728 | | |
| 729 | + | |
| 730 | + | |
| 731 | + | |
| 732 | + | |
| 733 | + | |
| 734 | + | |
701 | 735 | | |
702 | 736 | | |
703 | 737 | | |
| |||
717 | 751 | | |
718 | 752 | | |
719 | 753 | | |
720 | | - | |
721 | | - | |
722 | | - | |
723 | | - | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
724 | 757 | | |
725 | 758 | | |
726 | 759 | | |
| |||
737 | 770 | | |
738 | 771 | | |
739 | 772 | | |
740 | | - | |
| 773 | + | |
| 774 | + | |
741 | 775 | | |
742 | | - | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
743 | 780 | | |
744 | 781 | | |
745 | 782 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
142 | 142 | | |
143 | 143 | | |
144 | 144 | | |
145 | | - | |
146 | | - | |
147 | | - | |
148 | | - | |
149 | | - | |
150 | | - | |
151 | | - | |
152 | | - | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | | - | |
| 158 | + | |
159 | 159 | | |
160 | 160 | | |
161 | 161 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
94 | 94 | | |
95 | 95 | | |
96 | 96 | | |
97 | | - | |
| 97 | + | |
| 98 | + | |
98 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
| |||
0 commit comments