From e047aae42e2265a6eb9b461a243757f0ddf470c6 Mon Sep 17 00:00:00 2001 From: Hannes Magnusson Date: Sun, 13 Apr 2014 09:48:41 -0700 Subject: [PATCH] Fixed bug#67062 (Requesting nonexistent files should produce HTTP 404 Not Found) --- error.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/error.php b/error.php index 23165b990..14423a7ae 100644 --- a/error.php +++ b/error.php @@ -170,13 +170,15 @@ if (preg_match("!^get/([^/]+)/from/([^/]+)(/mirror)?$!", $URI, $dlinfo)) { error_nomirror($mr); exit; } + // Start the download process - status_header(200); include $_SERVER['DOCUMENT_ROOT'] . "/include/do-download.inc"; $filename = get_actual_download_file($df); if ($filename) { + status_header(200); download_file($mr, $filename); } else { + status_header(404); /* The file didn't exist on this server.. ask the user to pick another mirror */ include $_SERVER['DOCUMENT_ROOT'] . "/include/get-download.inc"; }