Skip to content

[Mime] Update mime types #58807

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
Nov 10, 2024
Merged

[Mime] Update mime types #58807

merged 1 commit into from
Nov 10, 2024

Conversation

smnandre
Copy link
Member

@smnandre smnandre commented Nov 8, 2024

Q A
Branch? 7.2
Bug fix? no
New feature? no
Deprecations? no
Issues Fix
License MIT

I had to update the prefered extensions map in src/Symfony/Component/Mime/Resources/bin/update_mime_types.php

-   'yaml' => ['application/yaml'],
-   'yml' => ['application/yaml'],
+   'yml' => ['application/yaml'],
+   'yaml' => ['application/yaml'],

This is the only way to make

  • 'application/yaml' first type for 'yaml' extension
  • 'application/yaml' first type for 'yml' extension
  • 'yaml' first extension for 'application/yaml' type
  • 'yml' second extension for 'application/yaml' type

If it's still possible before 7.2 ?

(last one was 8 months ago)

@@ -2770,7 +2830,7 @@ public function guessMimeType(string $path): ?string
'mp21' => ['application/mp21'],
'mp2a' => ['audio/mpeg'],
'mp3' => ['audio/mpeg', 'audio/mp3', 'audio/x-mp3', 'audio/x-mpeg', 'audio/x-mpg'],
'mp4' => ['video/mp4', 'video/mp4v-es', 'video/x-m4v'],
'mp4' => ['application/mp4', 'video/mp4', 'video/mp4v-es', 'video/x-m4v'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one and the next one seem suspicious to me.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

application/mp4 is a registered mime type

Do you think we should add a special case for it to grant the first place to "video/mp4" (as we do for mp3 and audi) ?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done it / cf last comment

@smnandre
Copy link
Member Author

smnandre commented Nov 9, 2024

Updated preferences for aac (same thing), mp4 and mpeg4

Yaml has changed due to our preferences (not sure why it did not in first commit, and a small new change for "vor" in the meanwhile)

@smnandre smnandre requested a review from fabpot November 9, 2024 16:15
@@ -1249,7 +1278,7 @@ public function guessMimeType(string $path): ?string
'application/xslt+xml' => ['xsl', 'xslt'],
'application/xspf+xml' => ['xspf'],
'application/xv+xml' => ['mxml', 'xhvml', 'xvml', 'xvm'],
'application/yaml' => ['yaml', 'yml'],
'application/yaml' => ['yml', 'yaml'],
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's not change this one as this is commonly used.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok i understand where the problem is coming from.

I updated the issue comment and added a comment in the update_mime_types.php file

(and fixed the MimeTypes.php file)

@fabpot
Copy link
Member

fabpot commented Nov 10, 2024

Thank you @smnandre.

@fabpot fabpot merged commit 9f81d93 into symfony:7.2 Nov 10, 2024
1 of 2 checks passed
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.

3 participants