Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/matomo-org/matomo.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'core/ProxyHttp.php')
-rw-r--r--core/ProxyHttp.php24
1 files changed, 3 insertions, 21 deletions
diff --git a/core/ProxyHttp.php b/core/ProxyHttp.php
index 69f7144b44..b2939e9a39 100644
--- a/core/ProxyHttp.php
+++ b/core/ProxyHttp.php
@@ -66,7 +66,7 @@ class ProxyHttp
{
// if the file cannot be found return HTTP status code '404'
if (!file_exists($file)) {
- self::setHttpStatus('404 Not Found');
+ Common::sendResponseCode(404);
return;
}
@@ -87,7 +87,7 @@ class ProxyHttp
// Return 304 if the file has not modified since
if ($modifiedSince === $lastModified) {
- self::setHttpStatus('304 Not Modified');
+ Common::sendResponseCode(304);
return;
}
@@ -158,7 +158,7 @@ class ProxyHttp
}
if (!_readfile($file, $byteStart, $byteEnd)) {
- self::setHttpStatus('505 Internal server error');
+ Common::sendResponseCode(500);
}
}
@@ -220,24 +220,6 @@ class ProxyHttp
}
/**
- * Set response header, e.g., HTTP/1.0 200 Ok
- *
- * @param string $status Status
- * @return bool
- */
- protected static function setHttpStatus($status)
- {
- if (strpos(PHP_SAPI, '-fcgi') === false) {
- $key = $_SERVER['SERVER_PROTOCOL'];
- } else {
- // FastCGI
- $key = 'Status:';
- }
-
- Common::sendHeader($key . ' ' . $status);
- }
-
- /**
* Returns a formatted Expires HTTP header for a certain number of days in the future. The result
* can be used in a call to `header()`.
*/