Commit 86754a8
committed
Use accept header instead of mangling request path.
Instead of appending a format to the request, it's much better
to just pass a more appropriate accept header. Rails will figure
out the format from that instead.
This allows devs to use `:as` on routes that don't have a format.
Introduce an `IdentityEncoder` to avoid `if request_encoder`,
essentially a better version of the purpose of the `WWWFormEncoder`.
One that makes conceptual sense on GET requests too.
Fixes rails#27144.1 parent 49aa974 commit 86754a8
File tree
3 files changed
+44
-24
lines changed- actionpack
- lib/action_dispatch/testing
- test/controller
3 files changed
+44
-24
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
211 | 211 | | |
212 | 212 | | |
213 | 213 | | |
214 | | - | |
| 214 | + | |
215 | 215 | | |
216 | 216 | | |
217 | 217 | | |
| |||
220 | 220 | | |
221 | 221 | | |
222 | 222 | | |
223 | | - | |
224 | | - | |
225 | 223 | | |
226 | 224 | | |
227 | 225 | | |
| |||
239 | 237 | | |
240 | 238 | | |
241 | 239 | | |
242 | | - | |
| 240 | + | |
243 | 241 | | |
244 | 242 | | |
245 | 243 | | |
| |||
291 | 289 | | |
292 | 290 | | |
293 | 291 | | |
294 | | - | |
| 292 | + | |
295 | 293 | | |
296 | 294 | | |
297 | | - | |
| 295 | + | |
298 | 296 | | |
299 | 297 | | |
300 | 298 | | |
| |||
Lines changed: 15 additions & 16 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | | - | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
4 | 11 | | |
5 | 12 | | |
6 | 13 | | |
7 | | - | |
| 14 | + | |
8 | 15 | | |
9 | 16 | | |
10 | 17 | | |
11 | 18 | | |
12 | 19 | | |
13 | 20 | | |
14 | 21 | | |
15 | | - | |
16 | | - | |
17 | | - | |
18 | | - | |
| 22 | + | |
| 23 | + | |
19 | 24 | | |
20 | 25 | | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 26 | + | |
| 27 | + | |
27 | 28 | | |
28 | 29 | | |
29 | | - | |
| 30 | + | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
| |||
40 | 41 | | |
41 | 42 | | |
42 | 43 | | |
43 | | - | |
| 44 | + | |
44 | 45 | | |
45 | 46 | | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
49 | 50 | | |
50 | 51 | | |
51 | | - | |
52 | | - | |
53 | 52 | | |
54 | 53 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
930 | 930 | | |
931 | 931 | | |
932 | 932 | | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
933 | 937 | | |
934 | 938 | | |
935 | 939 | | |
| |||
958 | 962 | | |
959 | 963 | | |
960 | 964 | | |
961 | | - | |
962 | 965 | | |
| 966 | + | |
| 967 | + | |
963 | 968 | | |
964 | 969 | | |
965 | 970 | | |
966 | 971 | | |
967 | 972 | | |
| 973 | + | |
| 974 | + | |
| 975 | + | |
| 976 | + | |
| 977 | + | |
| 978 | + | |
| 979 | + | |
| 980 | + | |
| 981 | + | |
| 982 | + | |
| 983 | + | |
| 984 | + | |
| 985 | + | |
| 986 | + | |
| 987 | + | |
| 988 | + | |
968 | 989 | | |
969 | 990 | | |
970 | 991 | | |
| |||
979 | 1000 | | |
980 | 1001 | | |
981 | 1002 | | |
982 | | - | |
| 1003 | + | |
983 | 1004 | | |
| 1005 | + | |
| 1006 | + | |
984 | 1007 | | |
985 | 1008 | | |
986 | 1009 | | |
| |||
0 commit comments