Skip to content

Commit 5791562

Browse files
committed
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.
1 parent 131f072 commit 5791562

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/berkeley_library/av/types/file_type.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def raise_if_duplicate(extensions)
5656
# ############################################################
5757
# Enum members
5858

59-
new(:MP3, 'audio', 'application/x-mpegURL', extensions: MP3_EXTENSIONS)
59+
new(:MP3, 'audio', 'audio/mpeg', extensions: MP3_EXTENSIONS)
6060
new(:MP4, 'video', 'video/mp4', extensions: MP4_EXTENSIONS)
6161
new(:UNKNOWN, 'object', 'application/octet-stream', label: 'Unknown')
6262

spec/lib/berkeley_library/av/types/file_type_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module Types
77
describe :mime_type do
88
it 'is correct' do
99
expected = {
10-
FileType::MP3 => 'application/x-mpegURL',
10+
FileType::MP3 => 'audio/mpeg',
1111
FileType::MP4 => 'video/mp4',
1212
FileType::UNKNOWN => 'application/octet-stream'
1313
}

0 commit comments

Comments
 (0)