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
path: root/core
diff options
context:
space:
mode:
authorMatthieu Aubry <mattab@users.noreply.github.com>2017-07-22 23:01:17 +0300
committerStefan Giehl <stefan@piwik.org>2017-07-22 23:01:17 +0300
commit7214a9b504a79955804e28dce1cdf7583588eb96 (patch)
tree1c2eba1147da524c7ea8c554c74630e28f7fd175 /core
parent5387018f82e074a941ce4f50e37db68cb9066264 (diff)
When tracker is in maintenande mode return HTTP status code 503 (instead of the current 200 and 400 http status cods) (#11773)
* When tracker is in maintenande mode, return HTTP status code 503 instead of the current status of 200 or 400 This will make our return code consistent with the UI which also returns 503 while in maintenance mode Learn more about starting a maintenance window: https://piwik.org/faq/how-to-update/faq_154/ * Update TrackerResponseTest.php * Update TrackerResponseTest.php
Diffstat (limited to 'core')
-rw-r--r--core/Tracker.php5
-rw-r--r--core/Tracker/Response.php1
2 files changed, 6 insertions, 0 deletions
diff --git a/core/Tracker.php b/core/Tracker.php
index 3ed757c638..43310c06a6 100644
--- a/core/Tracker.php
+++ b/core/Tracker.php
@@ -264,6 +264,11 @@ class Tracker
TrackerConfig::setConfigValue('enable_fingerprinting_across_websites', 1);
}
+ // Tests can simulate the tracker API maintenance mode
+ if (Common::getRequestVar('forceEnableTrackerMaintenanceMode', false, null, $args) == 1) {
+ TrackerConfig::setConfigValue('record_statistics', 0);
+ }
+
// Tests can force the use of 3rd party cookie for ID visitor
if (Common::getRequestVar('forceUseThirdPartyCookie', false, null, $args) == 1) {
TrackerConfig::setConfigValue('use_third_party_id_cookie', 1);
diff --git a/core/Tracker/Response.php b/core/Tracker/Response.php
index 7927666511..d5a01d7c24 100644
--- a/core/Tracker/Response.php
+++ b/core/Tracker/Response.php
@@ -71,6 +71,7 @@ class Response
public function outputResponse(Tracker $tracker)
{
if (!$tracker->shouldRecordStatistics()) {
+ Common::sendResponseCode(503);
$this->outputApiResponse($tracker);
Common::printDebug("Logging disabled, display transparent logo");
} elseif (!$tracker->hasLoggedRequests()) {