summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Faure <faure@kde.org>2020-12-27 19:28:38 +0100
committerDavid Faure <faure@kde.org>2020-12-30 16:15:17 +0000
commitd09c791a28ab939c92f8d58856b046f8f0ae5d77 (patch)
treee3204fee92ae31e2ff9dbb7c924433c7e732d4b9
parent02c51b9e07666011b81e0b518e9c16cf9ed88eae (diff)
downloadshared-mime-info-work/dfaure/adapt_to_xdgmime_change.tar.gz
Adapt to xdgmime behaviour change.work/dfaure/adapt_to_xdgmime_change
As the spec says, if the result from magic sniffing doesn't match one of the globs, ignore it and return one of the globs. With this change, test-garbage.key (which was already a doubtful testcase, see !5) no longer falls back to application/octet-stream but to one of the globs. test-really-html-not-xhtml.html is also fixed by this, it's detected as text/html. Closes: #138.
-rw-r--r--data/freedesktop.org.xml.in2
-rw-r--r--tests/mime-detection/list4
2 files changed, 4 insertions, 2 deletions
diff --git a/data/freedesktop.org.xml.in b/data/freedesktop.org.xml.in
index 8bc631df..0ef5c608 100644
--- a/data/freedesktop.org.xml.in
+++ b/data/freedesktop.org.xml.in
@@ -1825,6 +1825,7 @@ command to generate the output files.
<magic priority="50">
<match type="string" value="SEGA PICO" offset="256"/>
</magic>
+ <glob pattern="*.iso"/>
</mime-type>
<mime-type type="application/x-saturn-rom">
<comment>Sega Saturn disc image</comment>
@@ -1841,6 +1842,7 @@ command to generate the output files.
<magic priority="50">
<match type="string" value="SEGA SEGAKATANA" offset="16"/>
</magic>
+ <glob pattern="*.iso"/>
</mime-type>
<mime-type type="application/x-nintendo-ds-rom">
<comment>Nintendo DS ROM</comment>
diff --git a/tests/mime-detection/list b/tests/mime-detection/list
index cb0c8841..16e62d96 100644
--- a/tests/mime-detection/list
+++ b/tests/mime-detection/list
@@ -89,7 +89,7 @@ test.xht application/xhtml+xml
# Copied from https://bugs.webkit.org/show_bug.cgi?id=201295#c0
test-html-with-svg.html text/html
# Copied from https://gitlab.freedesktop.org/xdg/shared-mime-info/issues/98
-test-really-html-not-xhtml.html text/html oxx
+test-really-html-not-xhtml.html text/html ox
# Copied from https://bugs.kde.org/show_bug.cgi?id=417248
test-really-html-not-perl.html text/html
# Copied from https://gitlab.freedesktop.org/xdg/shared-mime-info/issues/120
@@ -727,7 +727,7 @@ test-secret-key.skr application/pgp-keys ooo
test-secret-key.asc application/pgp-keys xoo
# not all *.key should be detected as Apple Keynote
test-secret.key application/pgp-keys x
-test-garbage.key application/octet-stream x
+test-garbage.key application/octet-stream xox
# copied from https://bitbucket.org/scons/scons/raw/f0d4664d36f8a4d4da53178cf947c86c86db3cb7/SConstruct
SConstruct text/x-scons oxo