1
0
mirror of https://github.com/laurent22/joplin.git synced 2025-12-20 23:30:05 +02:00

Clipper: Fixes #1600: Handle SVG images and fix issue with invalid file extensions

This commit is contained in:
Laurent Cozic
2019-06-12 09:45:31 +01:00
parent d6218f35fe
commit ad211b4b4e
3 changed files with 29 additions and 3 deletions

View File

@@ -30,4 +30,11 @@ netUtils.findAvailablePort = async (possiblePorts, extraRandomPortsToTry = 20) =
return port;
}
netUtils.mimeTypeFromHeaders = headers => {
if (!headers || !headers['content-type']) return null;
const splitted = headers['content-type'].split(';');
return splitted[0].trim().toLowerCase();
}
module.exports = { netUtils };