Hi, thanks for your great work.
I am using Nextcloud 21 and Sharingpath 0.4.1, installed manually.
I am serving my shared images through an image processor (imagekit.io) with a layer of caching on cloudflare.
My SVG files do not render as images, but render as text content.
In the mimetypemapping.dist.json file on nextcloud 21, the svg extension has the following values:
"image/svg+xml" AND "text/plain"
When using the getSecureMimeType function in nextcloud-sharing-path/lib/Controller/PathController.php, only the second value is sent, so the SVG file renders as plain text.
Hi, thanks for your great work. I am using Nextcloud 21 and Sharingpath 0.4.1, installed manually. I am serving my shared images through an image processor (imagekit.io) with a layer of caching on cloudflare.
My SVG files do not render as images, but render as text content.
In the mimetypemapping.dist.json file on nextcloud 21, the svg extension has the following values:
"image/svg+xml"
AND"text/plain"
When using the
getSecureMimeType
function innextcloud-sharing-path/lib/Controller/PathController.php
, only the second value is sent, so the SVG file renders as plain text.To fix this, I created the following file in my nextcloud installation (doc https://docs.nextcloud.com/server/latest/admin_manual/configuration_mimetypes/index.html ) :
<nextcloud_root>/config/mimetypemapping.json
with content:
{ "svg": ["image/svg+xml"] }
So it will always return the correct mime type for svg files.
Maybe you could update the
getSecureMimeType
behaviour?