From ec299e4c5464d2e6e03ea5e7a695d03a966c836d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mar=C3=ADa=20A=2E=20Matienzo?= Date: Wed, 5 Nov 2025 16:01:21 -0800 Subject: [PATCH] AP-487: correctly declare mime type for mp3s identified in code review of BerkeleyLibrary/avplayer#17. the declared mime types as specified for FileType::MP3 erroneously are using the mime type for m3u8 playlists instead of the correct mime type for mp3 data. --- lib/berkeley_library/av/types/file_type.rb | 2 +- spec/lib/berkeley_library/av/types/file_type_spec.rb | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/berkeley_library/av/types/file_type.rb b/lib/berkeley_library/av/types/file_type.rb index 891e020..5630083 100644 --- a/lib/berkeley_library/av/types/file_type.rb +++ b/lib/berkeley_library/av/types/file_type.rb @@ -56,7 +56,7 @@ def raise_if_duplicate(extensions) # ############################################################ # Enum members - new(:MP3, 'audio', 'application/x-mpegURL', extensions: MP3_EXTENSIONS) + new(:MP3, 'audio', 'audio/mpeg', extensions: MP3_EXTENSIONS) new(:MP4, 'video', 'video/mp4', extensions: MP4_EXTENSIONS) new(:UNKNOWN, 'object', 'application/octet-stream', label: 'Unknown') diff --git a/spec/lib/berkeley_library/av/types/file_type_spec.rb b/spec/lib/berkeley_library/av/types/file_type_spec.rb index 02f91e0..1797ba4 100644 --- a/spec/lib/berkeley_library/av/types/file_type_spec.rb +++ b/spec/lib/berkeley_library/av/types/file_type_spec.rb @@ -7,7 +7,7 @@ module Types describe :mime_type do it 'is correct' do expected = { - FileType::MP3 => 'application/x-mpegURL', + FileType::MP3 => 'audio/mpeg', FileType::MP4 => 'video/mp4', FileType::UNKNOWN => 'application/octet-stream' }