Skip to content

Commit

Permalink
Merge commit 'refs/pull/518/head' of https://github.com/seblucas/cops
Browse files Browse the repository at this point in the history
  • Loading branch information
mikespub committed Mar 24, 2023
2 parents cc5aa72 + e4ff7c4 commit 58306bf
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions fetch.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* COPS (Calibre OPDS PHP Server)
*
* @license GPL 2 (http://www.gnu.org/licenses/gpl.html)
* @author Sébastien Lucas <[email protected]>
* @author Sébastien Lucas <[email protected]>
*/

require_once dirname(__FILE__) . '/config.php';
Expand All @@ -18,6 +18,8 @@
return;
}
}
// clean output buffers before sending the ebook data do avoid high memory usage on big ebooks (ie. comic books)
ob_end_clean();

$expires = 60*60*24*14;
header('Pragma: public');
Expand Down Expand Up @@ -117,9 +119,9 @@

if (empty($config['cops_x_accel_redirect'])) {
$filename = $dir . $file;
$fp = fopen($filename, 'rb');
header('Content-Length: ' . filesize($filename));
fpassthru($fp);
readfile($filename);
} else {
header($config['cops_x_accel_redirect'] . ': ' . $dir . $file);
}
exit();

0 comments on commit 58306bf

Please sign in to comment.