Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork9.7k
[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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Uh oh!
There was an error while loading.Please reload this page.
Uh oh!
There was an error while loading.Please reload this page.
a7beaed to89470adCompareUh oh!
There was an error while loading.Please reload this page.
89470ad to309a6b7CompareUh oh!
There was an error while loading.Please reload this page.
Expanded the MIME type list in `Request::getMimeTypes()` to include mappings for YAML, WBXML, PDF, and CSV formats.
309a6b7 tof2ba0b3CompareThank you@Spomky. |
e0365cc intosymfony:7.4Uh oh!
There was an error while loading.Please reload this page.
…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 | MITFix tests from#61267 (remaining failures unrelated).Commits-------3816617 [HttpFoundation] Don’t check suffix on empty MIME type
Adding the new argument to the |
Indeed it is not in line with |
nicolas-grekas commentedAug 27, 2025 • edited
Loading Uh oh!
There was an error while loading.Please reload this page.
edited
Uh oh!
There was an error while loading.Please reload this page.
While at it, maybe turn the added private method into a constant? |
…tured suffix formats as constant
Hi, |
…tured suffix formats as constant
…tured suffix formats as constant
…tructured suffix formats as constant (Spomky)This PR was merged into the 7.4 branch.Discussion----------[HttpFoundation] Fix BC Break introduces in `#61267` and structured suffix formats as constant| Q | A| ------------- | ---| Branch? | 7.4| Bug fix? | no| New feature? | no <!-- if yes, also update src/**/CHANGELOG.md -->| Deprecations? | no <!-- if yes, also update UPGRADE-*.md and src/**/CHANGELOG.md -->| Issues | Fix #... <!-- prefix each issue number with "Fix #"; no need to create an issue if none exists, explain below -->| License | MIT<!--🛠️ Replace this text with a concise explanation of your change:- What it does and why it's needed- A simple example of how it works (include PHP, YAML, etc.)- If it modifies existing behavior, include a before/after comparisonContributor guidelines:- ✅ Add tests and ensure they pass- 🐞 Bug fixes must target the **lowest maintained** branch where they applyhttps://symfony.com/releases#maintained-symfony-branches- ✨ New features and deprecations must target the **feature** branch and must add an entry to the changelog file of the patched component:https://symfony.com/doc/current/contributing/code/conventions.html#writing-a-changelog-entry- 🔒 Do not break backward compatibility:https://symfony.com/bc-->Commits-------aec348d [HttpFoundation] Fix BC Break introduces in `#61267` and structured suffix formats as constant
…edefined formats (longwave)This PR was merged into the 6.4 branch.Discussion----------[HttpFoundation] Allow Request::setFormat() to override predefined formats| Q | A| ------------- | ---| Branch? | 6.4| Bug fix? | yes| New feature? | no| Deprecations? | no| Issues |Fix#62226| License | MITSince#61267 some additional MIME formats are predefined; in order to override the predefined formats you must explictly deregister them. This PR changes the order so formats added later take precedence.Commits-------2402d16 [HttpFoundation] Allow Request::setFormat() to override predefined formats
Uh oh!
There was an error while loading.Please reload this page.
Extended MIME type handling in
Request::getFormat()to support structured suffixes likeapplication/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 ofxml)problem: application/problem+jsonhal: application/hal+json, application/hal+xmljsonapi: application/vnd.api+jsonyaml: text/yaml, application/x-yamlwbxml: application/vnd.wap.wbxmlpdf: application/pdfcsv: text/csv