Merge remote-tracking branch 'skl85/hotfix-extautodetect'
[phorkie.git] / www / raw.php
index 28f7c56ee6ca3475a68507e3de2e27ec422a48d7..8bda11e8fbaeb9b363bb726bf27239ad9de32eef 100644 (file)
@@ -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();
+}
 ?>