X-Git-Url: https://git.cweiske.de/phancap.git/blobdiff_plain/39f9a7bf597c07be6cee65f60bec1fb33e04bbf0..09ad15fd2ed08bbfb4ed4d70ff21f774387aa204:/www/get.php diff --git a/www/get.php b/www/get.php index 694b843..d4b70d3 100644 --- a/www/get.php +++ b/www/get.php @@ -61,10 +61,14 @@ try { $img = $rep->getImage($options); if ($config->redirect) { header('HTTP/1.0 302 Found'); + header('phancap-file: ' . $img->name); header('Expires: ' . date('r', $img->getExpiryDate($options))); header('Location: ' . $img->getUrl()); } else { - header('Content-type: ' . $img->getMimeType()); + header('HTTP/1.0 200 OK'); + header('phancap-file: ' . $img->name); + header('Content-Type: ' . $img->getMimeType()); + header('Content-Length: ' . filesize($img->getPath())); readfile($img->getPath()); } } catch (\Exception $e) {