aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Marien Fressinaud <dev@marienfressinaud.fr> 2019-07-31 13:49:29 +0200
committerGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2019-07-31 13:49:29 +0200
commit7533676ae75b3c09178d4e99bbbf6bee30d13100 (patch)
tree888fb6a55b9e3c8cd19653f32e1eaf66f9857e41
parentf5fbc0c7f08efd616a4d24985916d88a846d1723 (diff)
Add support for images to the ext.php endpoint (#2465)
-rw-r--r--p/ext.php17
1 files changed, 17 insertions, 0 deletions
diff --git a/p/ext.php b/p/ext.php
index 1b123f47d..3035aae7d 100644
--- a/p/ext.php
+++ b/p/ext.php
@@ -59,6 +59,23 @@ case 'js':
header('Content-Type: application/javascript; charset=UTF-8');
header('Content-Disposition: inline; filename="' . $file_name . '"');
break;
+case 'png':
+ header('Content-Type: image/png');
+ header('Content-Disposition: inline; filename="' . $file_name . '"');
+ break;
+case 'jpeg':
+case 'jpg':
+ header('Content-Type: image/jpeg');
+ header('Content-Disposition: inline; filename="' . $file_name . '"');
+ break;
+case 'gif':
+ header('Content-Type: image/gif');
+ header('Content-Disposition: inline; filename="' . $file_name . '"');
+ break;
+case 'svg':
+ header('Content-Type: image/svg+xml');
+ header('Content-Disposition: inline; filename="' . $file_name . '"');
+ break;
default:
header('HTTP/1.1 400 Bad Request');
die();