-
-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[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
Conversation
a7beaed to
89470ad
Compare
89470ad to
309a6b7
Compare
Expanded the MIME type list in `Request::getMimeTypes()` to include mappings for YAML, WBXML, PDF, and CSV formats.
309a6b7 to
f2ba0b3
Compare
|
Thank you @Spomky. |
…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
|
Adding the new argument to the |
Indeed it is not in line with |
|
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 comparison Contributor guidelines: - ✅ Add tests and ensure they pass - 🐞 Bug fixes must target the **lowest maintained** branch where they apply https://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 | MIT Since #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
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