Commit 922a650
committed
fix: api command preserves raw string responses, fix null body header divergence
Address three bot review comments:
1. String response quoting regression (Seer + BugBot): the api command
is a raw proxy — non-JSON responses (plain text, HTML error pages)
must not be wrapped in JSON quotes. Revert to output: 'json'
(flag-only) and write response body imperatively via writeResponseBody,
which writes strings directly and JSON-formats objects with --fields.
2. Null body header divergence (BugBot): resolveEffectiveHeaders had an
extra body !== null check that rawApiRequest doesn't. For --data
"null", dry-run would omit Content-Type while the real request adds
it. Aligned condition to match rawApiRequest exactly:
!(isStringBody || hasContentType) && body !== undefined.
3. Stale comment about dry-run always outputting JSON (BugBot on old
commit 70e7f2d): the referenced code was completely rewritten in
6980508. No action needed — will reply to dismiss.
Also reverts OutputConfig.human back to required (the JSON-only config
form is no longer needed since the api command doesn't use it).1 parent 997570c commit 922a650
File tree
3 files changed
+113
-33
lines changed- src
- commands
- lib/formatters
- test/commands
3 files changed
+113
-33
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | | - | |
| 32 | + | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
| |||
864 | 864 | | |
865 | 865 | | |
866 | 866 | | |
| 867 | + | |
| 868 | + | |
| 869 | + | |
| 870 | + | |
| 871 | + | |
| 872 | + | |
| 873 | + | |
| 874 | + | |
| 875 | + | |
| 876 | + | |
| 877 | + | |
| 878 | + | |
| 879 | + | |
| 880 | + | |
| 881 | + | |
| 882 | + | |
| 883 | + | |
| 884 | + | |
| 885 | + | |
| 886 | + | |
| 887 | + | |
| 888 | + | |
| 889 | + | |
| 890 | + | |
| 891 | + | |
867 | 892 | | |
868 | 893 | | |
869 | 894 | | |
| |||
933 | 958 | | |
934 | 959 | | |
935 | 960 | | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
936 | 964 | | |
937 | | - | |
938 | | - | |
939 | | - | |
940 | | - | |
941 | | - | |
942 | | - | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
943 | 969 | | |
944 | 970 | | |
945 | 971 | | |
| |||
1068 | 1094 | | |
1069 | 1095 | | |
1070 | 1096 | | |
1071 | | - | |
| 1097 | + | |
1072 | 1098 | | |
1073 | 1099 | | |
1074 | 1100 | | |
| |||
1191 | 1217 | | |
1192 | 1218 | | |
1193 | 1219 | | |
| 1220 | + | |
1194 | 1221 | | |
1195 | 1222 | | |
1196 | | - | |
1197 | | - | |
| 1223 | + | |
| 1224 | + | |
| 1225 | + | |
1198 | 1226 | | |
1199 | 1227 | | |
1200 | 1228 | | |
1201 | 1229 | | |
1202 | 1230 | | |
1203 | | - | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
1204 | 1234 | | |
1205 | 1235 | | |
1206 | 1236 | | |
| |||
1225 | 1255 | | |
1226 | 1256 | | |
1227 | 1257 | | |
1228 | | - | |
| 1258 | + | |
1229 | 1259 | | |
1230 | 1260 | | |
1231 | 1261 | | |
1232 | 1262 | | |
1233 | 1263 | | |
1234 | 1264 | | |
1235 | | - | |
1236 | | - | |
1237 | | - | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
1238 | 1272 | | |
1239 | | - | |
1240 | 1273 | | |
1241 | 1274 | | |
1242 | | - | |
1243 | | - | |
1244 | 1275 | | |
1245 | 1276 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| |||
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
72 | | - | |
73 | | - | |
74 | | - | |
75 | 72 | | |
76 | 73 | | |
77 | 74 | | |
78 | 75 | | |
79 | 76 | | |
80 | 77 | | |
81 | | - | |
82 | | - | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
| 78 | + | |
| 79 | + | |
89 | 80 | | |
90 | 81 | | |
91 | 82 | | |
| |||
145 | 136 | | |
146 | 137 | | |
147 | 138 | | |
148 | | - | |
149 | | - | |
| 139 | + | |
150 | 140 | | |
151 | 141 | | |
152 | 142 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
912 | 913 | | |
913 | 914 | | |
914 | 915 | | |
| 916 | + | |
| 917 | + | |
| 918 | + | |
| 919 | + | |
| 920 | + | |
| 921 | + | |
| 922 | + | |
| 923 | + | |
| 924 | + | |
| 925 | + | |
| 926 | + | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
| 942 | + | |
| 943 | + | |
| 944 | + | |
| 945 | + | |
| 946 | + | |
| 947 | + | |
| 948 | + | |
| 949 | + | |
| 950 | + | |
| 951 | + | |
| 952 | + | |
| 953 | + | |
| 954 | + | |
| 955 | + | |
| 956 | + | |
| 957 | + | |
| 958 | + | |
| 959 | + | |
| 960 | + | |
| 961 | + | |
| 962 | + | |
| 963 | + | |
915 | 964 | | |
916 | 965 | | |
917 | 966 | | |
| |||
1111 | 1160 | | |
1112 | 1161 | | |
1113 | 1162 | | |
| 1163 | + | |
| 1164 | + | |
| 1165 | + | |
| 1166 | + | |
| 1167 | + | |
| 1168 | + | |
| 1169 | + | |
| 1170 | + | |
| 1171 | + | |
| 1172 | + | |
1114 | 1173 | | |
1115 | 1174 | | |
1116 | 1175 | | |
| |||
0 commit comments