Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/nextcloud/gallery.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOlivier Paroz <github@oparoz.com>2015-09-18 22:57:49 +0300
committerOlivier Paroz <github@oparoz.com>2015-09-20 22:22:18 +0300
commit3bf119c9fa0100d5c04f5c75366362a779c6c94c (patch)
tree5e59603d49b1943f7a84be0eed909daccc43ca73 /controller
parentf74f8acc349d9a411978d87940c8434ec7a7e657 (diff)
Send SVG as text/plain on download endpoints
Diffstat (limited to 'controller')
-rw-r--r--controller/filesapicontroller.php5
-rw-r--r--controller/filescontroller.php5
2 files changed, 10 insertions, 0 deletions
diff --git a/controller/filesapicontroller.php b/controller/filesapicontroller.php
index 53bbef64..057b38f0 100644
--- a/controller/filesapicontroller.php
+++ b/controller/filesapicontroller.php
@@ -127,6 +127,11 @@ class FilesApiController extends ApiController {
return new RedirectResponse($url);
}
+ // That's the only exception out of all the image media types
+ if ($download['mimetype'] === 'image/svg+xml') {
+ $download['mimetype'] = 'text/plain';
+ }
+
return new ImageResponse($download);
}
diff --git a/controller/filescontroller.php b/controller/filescontroller.php
index c64bc021..81269bba 100644
--- a/controller/filescontroller.php
+++ b/controller/filescontroller.php
@@ -126,6 +126,11 @@ class FilesController extends Controller {
return $response;
}
+ // That's the only exception out of all the image media types we serve
+ if ($download['mimetype'] === 'image/svg+xml') {
+ $download['mimetype'] = 'text/plain';
+ }
+
return new ImageResponse($download);
}