File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -99,7 +99,7 @@ defmodule MIME do
9999 "image/gif" => [ "gif" ] ,
100100 "image/heic" => [ "heic" ] ,
101101 "image/heif" => [ "heif" ] ,
102- "image/jp2" => [ ". jp2" ] ,
102+ "image/jp2" => [ "jp2" ] ,
103103 "image/jpeg" => [ "jpg" , "jpeg" ] ,
104104 "image/jxl" => [ "jxl" ] ,
105105 "image/png" => [ "png" ] ,
Original file line number Diff line number Diff line change @@ -30,6 +30,13 @@ defmodule MIMETest do
3030 assert extensions ( "application/vnd.custom+xml/extrainvalid" ) == [ ]
3131 end
3232
33+ test "extensions must not lead with a dot" do
34+ for { type , exts } <- known_types ( ) , ext <- exts do
35+ expected = String . replace_leading ( ext , "." , "" )
36+ assert expected == ext , "type '#{ type } ' includes '#{ ext } ', replace it with '#{ expected } '."
37+ end
38+ end
39+
3340 test "type/1" do
3441 assert type ( "json" ) == "application/json"
3542 assert type ( "foo" ) == "application/octet-stream"
You can’t perform that action at this time.
0 commit comments