Skip to content

Commit

Permalink
override mp4 default
Browse files Browse the repository at this point in the history
  • Loading branch information
fonsp committed Nov 5, 2024
1 parent f787d3e commit 3919eb0
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion mimedb/mimedb.jlon

Large diffs are not rendered by default.

5 changes: 5 additions & 0 deletions mimedb/update.jl
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ begin
_ext2mime[ex] = mime
end
end

# Changing the default mime for the .mp4 extension to video/mp4
# this is the more common and expected type, and makes the assumption that the file contains video
# The RFC https://www.rfc-editor.org/rfc/rfc4337.txt does not specify a **default** mime type for mp4 files, it should depend on content. application/mp4 should be used for mp4 files without video/audio content, so it is not necessarily a better default than video/mp4.
_ext2mime["mp4"] = "video/mp4"

@info "✏ writing to file $mdb..."
open(mdb, "w") do f
Expand Down
6 changes: 4 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,11 @@ const mdn = Dict(
".jsonld" => "application/ld+json",
".mjs" => "text/javascript",
".mp3" => "audio/mpeg",
".mp4" => "application/mp4",
".mp4" => "video/mp4",
".mp4s" => "application/mp4",
".mpeg" => "video/mpeg",
".ogx" => "application/ogg", ".otf" => "font/otf",
".ogx" => "application/ogg",
".otf" => "font/otf",
".png" => "image/png",
".pdf" => "application/pdf",
".rtf" => "application/rtf",
Expand Down

0 comments on commit 3919eb0

Please sign in to comment.