Skip to content

[HttpFoundation] Add support for structured MIME suffix #61267

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Aug 20, 2025

Conversation

Spomky
Copy link
Contributor

@Spomky Spomky commented Jul 30, 2025

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

@Spomky Spomky force-pushed the features/hybrid-mime-format branch 2 times, most recently from a7beaed to 89470ad Compare July 30, 2025 20:00
Expanded the MIME type list in `Request::getMimeTypes()` to include mappings for YAML, WBXML, PDF, and CSV formats.
@Spomky Spomky force-pushed the features/hybrid-mime-format branch from 309a6b7 to f2ba0b3 Compare August 20, 2025 06:36
@fabpot
Copy link
Member

fabpot commented Aug 20, 2025

Thank you @Spomky.

@fabpot fabpot merged commit e0365cc into symfony:7.4 Aug 20, 2025
4 of 12 checks passed
nicolas-grekas added a commit that referenced this pull request Aug 20, 2025
…MatTheCat)

This PR was squashed before being merged into the 7.4 branch.

Discussion
----------

[HttpFoundation] Don’t check suffix on empty MIME type

| Q             | A
| ------------- | ---
| Branch?       | 7.4
| Bug fix?      | yes
| New feature?  | no
| Deprecations? | no
| Issues        | N/A
| License       | MIT

Fix tests from #61267 (remaining failures unrelated).

Commits
-------

3816617 [HttpFoundation] Don’t check suffix on empty MIME type
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants