Skip to content

Commit

Permalink
fix: update MIME filetype strings based off latest IANA media type spec
Browse files Browse the repository at this point in the history
  • Loading branch information
bojand committed Jun 21, 2020
1 parent bb74197 commit fcbd3c5
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 13 deletions.
10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ assert_eq!("foo", res.ext);
- **heif** - `image/heif`
- **jxr** - `image/vnd.ms-photo`
- **psd** - `image/vnd.adobe.photoshop`
- **ico** - `image/x-icon`
- **ico** - `image/vnd.microsoft.icon`

#### Video

Expand Down Expand Up @@ -142,7 +142,7 @@ assert_eq!("foo", res.ext);
- **epub** - `application/epub+zip`
- **zip** - `application/zip`
- **tar** - `application/x-tar`
- **rar** - `application/x-rar-compressed`
- **rar** - `application/vnd.rar`
- **gz** - `application/gzip`
- **bz2** - `application/x-bzip2`
- **7z** - `application/x-7z-compressed`
Expand All @@ -152,11 +152,11 @@ assert_eq!("foo", res.ext);
- **rtf** - `application/rtf`
- **eot** - `application/octet-stream`
- **ps** - `application/postscript`
- **sqlite** - `application/x-sqlite3`
- **sqlite** - `application/vnd.sqlite3`
- **nes** - `application/x-nintendo-nes-rom`
- **crx** - `application/x-google-chrome-extension`
- **cab** - `application/vnd.ms-cab-compressed`
- **deb** - `application/x-deb`
- **deb** - `application/vnd.debian.binary-package`
- **ar** - `application/x-unix-archive`
- **Z** - `application/x-compress`
- **lz** - `application/x-lzip`
Expand All @@ -183,7 +183,7 @@ assert_eq!("foo", res.ext);
#### Application

- **wasm** - `application/wasm`
- **exe** - `application/x-msdownload`
- **exe** - `application/vnd.microsoft.portable-executable`
- **elf** - `application/x-executable`
- **bc** - `application/llvm`
- **class** - `application/java`
Expand Down
10 changes: 5 additions & 5 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ pub fn setup(v: &mut Vec<(MatcherType, String, String, Matcher)>) {
));
v.push((
MatcherType::APP,
"application/x-msdownload".to_string(),
"application/vnd.microsoft.portable-executable".to_string(),
"exe".to_string(),
matchers::app::is_exe as Matcher,
));
Expand Down Expand Up @@ -114,7 +114,7 @@ pub fn setup(v: &mut Vec<(MatcherType, String, String, Matcher)>) {
));
v.push((
MatcherType::IMAGE,
"image/x-icon".to_string(),
"image/vnd.microsoft.icon".to_string(),
"ico".to_string(),
matchers::image::is_ico as Matcher,
));
Expand Down Expand Up @@ -317,7 +317,7 @@ pub fn setup(v: &mut Vec<(MatcherType, String, String, Matcher)>) {
));
v.push((
MatcherType::ARCHIVE,
"application/x-rar-compressed".to_string(),
"application/vnd.rar".to_string(),
"rar".to_string(),
matchers::archive::is_rar as Matcher,
));
Expand Down Expand Up @@ -377,7 +377,7 @@ pub fn setup(v: &mut Vec<(MatcherType, String, String, Matcher)>) {
));
v.push((
MatcherType::ARCHIVE,
"application/x-sqlite3".to_string(),
"application/vnd.sqlite3".to_string(),
"sqlite".to_string(),
matchers::archive::is_sqlite as Matcher,
));
Expand All @@ -401,7 +401,7 @@ pub fn setup(v: &mut Vec<(MatcherType, String, String, Matcher)>) {
));
v.push((
MatcherType::ARCHIVE,
"application/x-deb".to_string(),
"application/vnd.debian.binary-package".to_string(),
"deb".to_string(),
matchers::archive::is_deb as Matcher,
));
Expand Down
4 changes: 2 additions & 2 deletions tests/archive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fn test_exe() {

assert_eq!(
infer::Type {
mime: String::from("application/x-msdownload"),
mime: String::from("application/vnd.microsoft.portable-executable"),
ext: String::from("exe"),
},
info.get_from_path("testdata/sample.exe").unwrap().unwrap()
Expand All @@ -34,7 +34,7 @@ fn test_sqlite() {

assert_eq!(
infer::Type {
mime: String::from("application/x-sqlite3"),
mime: String::from("application/vnd.sqlite3"),
ext: String::from("sqlite"),
},
info.get_from_path("testdata/sample.db").unwrap().unwrap()
Expand Down
2 changes: 1 addition & 1 deletion tests/image.rs
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,7 @@ fn test_ico() {

assert_eq!(
infer::Type {
mime: String::from("image/x-icon"),
mime: String::from("image/vnd.microsoft.icon"),
ext: String::from("ico"),
},
info.get_from_path("testdata/sample.ico").unwrap().unwrap()
Expand Down

0 comments on commit fcbd3c5

Please sign in to comment.