aboutsummaryrefslogtreecommitdiff
path: root/www/raw.php
diff options
context:
space:
mode:
Diffstat (limited to 'www/raw.php')
-rw-r--r--www/raw.php7
1 files changed, 6 insertions, 1 deletions
diff --git a/www/raw.php b/www/raw.php
index 28f7c56..8bda11e 100644
--- a/www/raw.php
+++ b/www/raw.php
@@ -17,5 +17,10 @@ if ($mimetype === null) {
$mimetype = 'text/plain';
}
header('Content-Type: ' . $mimetype);
-readfile($file->getFullPath());
+if ($repo->hash === null) {
+ //IIRC readfile is not so memory-intensive for big files
+ readfile($file->getFullPath());
+} else {
+ echo $file->getContent();
+}
?>