Skip to content
Snippets Groups Projects
Commit 94f2c20d authored by MeiMei's avatar MeiMei Committed by syuilo
Browse files

Fix #4413 (#4417)

parent c1deb943
No related branches found
No related tags found
No related merge requests found
......@@ -101,7 +101,11 @@ async function detectMine(path: string) {
readable.destroy();
const type = fileType(buffer);
if (type) {
res([type.mime, type.ext]);
if (type.mime == 'application/xml' && checkSvg(path)) {
res(['image/svg+xml', 'svg']);
} else {
res([type.mime, type.ext]);
}
} else if (checkSvg(path)) {
res(['image/svg+xml', 'svg']);
} else {
......
......@@ -310,7 +310,11 @@ export default async function(
readable.destroy();
const type = fileType(buffer);
if (type) {
res([type.mime, type.ext]);
if (type.mime == 'application/xml' && checkSvg(path)) {
res(['image/svg+xml', 'svg']);
} else {
res([type.mime, type.ext]);
}
} else if (checkSvg(path)) {
res(['image/svg+xml', 'svg']);
} else {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment