1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-11-27 22:38:39 +09:00
This commit is contained in:
MeiMei 2019-03-05 07:56:23 +09:00 committed by syuilo
parent c1deb9438d
commit 94f2c20d35
2 changed files with 10 additions and 2 deletions

View File

@ -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 {

View File

@ -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 {