Commit e0365cc
committed
feature #61267 [HttpFoundation] Add support for structured MIME suffix (Spomky)
This PR was merged into the 7.4 branch.
Discussion
----------
[HttpFoundation] Add support for structured MIME suffix
| Q | A
| ------------- | ---
| Branch? | 7.4
| Bug fix? | no
| New feature? | yes
| Deprecations? | no
| Issues | Fix #61213
| License | MIT
Extended MIME type handling in `Request::getFormat()` to support structured suffixes like `application/soap+xml`. Introduced a private method to define fallback formats based on RFC specifications. Updated the test suite accordingly.
It adds supports for common mime types:
* `soap`: application/soap+xml (instead of `xml`)
* `problem`: application/problem+json
* `hal`: application/hal+json, application/hal+xml
* `jsonapi`: application/vnd.api+json
* `yaml`: text/yaml, application/x-yaml
* `wbxml`: application/vnd.wap.wbxml
* `pdf`: application/pdf
* `csv`: text/csv
Commits
-------
f2ba0b3 [HttpFoundation] Add new MIME type mappings to `getMimeTypes()``File tree
3 files changed
+102
-1
lines changed- src/Symfony/Component/HttpFoundation
- Tests
3 files changed
+102
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1226 | 1226 | | |
1227 | 1227 | | |
1228 | 1228 | | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
| 1232 | + | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
| 1236 | + | |
| 1237 | + | |
| 1238 | + | |
| 1239 | + | |
| 1240 | + | |
1229 | 1241 | | |
1230 | | - | |
| 1242 | + | |
1231 | 1243 | | |
1232 | 1244 | | |
1233 | 1245 | | |
| |||
1247 | 1259 | | |
1248 | 1260 | | |
1249 | 1261 | | |
| 1262 | + | |
| 1263 | + | |
| 1264 | + | |
| 1265 | + | |
| 1266 | + | |
| 1267 | + | |
| 1268 | + | |
| 1269 | + | |
| 1270 | + | |
| 1271 | + | |
| 1272 | + | |
| 1273 | + | |
| 1274 | + | |
| 1275 | + | |
| 1276 | + | |
| 1277 | + | |
| 1278 | + | |
| 1279 | + | |
| 1280 | + | |
| 1281 | + | |
| 1282 | + | |
1250 | 1283 | | |
1251 | 1284 | | |
1252 | 1285 | | |
| |||
1919 | 1952 | | |
1920 | 1953 | | |
1921 | 1954 | | |
| 1955 | + | |
| 1956 | + | |
| 1957 | + | |
| 1958 | + | |
| 1959 | + | |
| 1960 | + | |
| 1961 | + | |
| 1962 | + | |
| 1963 | + | |
| 1964 | + | |
| 1965 | + | |
| 1966 | + | |
| 1967 | + | |
| 1968 | + | |
| 1969 | + | |
| 1970 | + | |
| 1971 | + | |
| 1972 | + | |
| 1973 | + | |
| 1974 | + | |
| 1975 | + | |
| 1976 | + | |
| 1977 | + | |
| 1978 | + | |
| 1979 | + | |
| 1980 | + | |
| 1981 | + | |
| 1982 | + | |
| 1983 | + | |
| 1984 | + | |
| 1985 | + | |
| 1986 | + | |
| 1987 | + | |
| 1988 | + | |
| 1989 | + | |
| 1990 | + | |
1922 | 1991 | | |
1923 | 1992 | | |
1924 | 1993 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
527 | 527 | | |
528 | 528 | | |
529 | 529 | | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
530 | 561 | | |
531 | 562 | | |
532 | 563 | | |
| |||
0 commit comments