From 00c43be22fa4436009ca9b9dc0e445496328a17e Mon Sep 17 00:00:00 2001 From: diosmosis Date: Tue, 5 Nov 2019 22:55:41 -0800 Subject: [PATCH] Wrong header is enabled only for GET. --- PiwikTracker.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/PiwikTracker.php b/PiwikTracker.php index 808dfc8..ddd93f8 100644 --- a/PiwikTracker.php +++ b/PiwikTracker.php @@ -1539,13 +1539,14 @@ protected function sendRequest($url, $method = 'GET', $data = null, $force = fal CURLOPT_USERAGENT => $this->userAgent, CURLOPT_HEADER => true, CURLOPT_TIMEOUT => $this->requestTimeout, + CURLOPT_RETURNTRANSFER => true, CURLOPT_HTTPHEADER => array( 'Accept-Language: ' . $this->acceptLanguage, ), ); if ($method === 'GET') { - $options[CURLOPT_RETURNTRANSFER] = true; + $options[CURLOPT_FOLLOWLOCATION] = true; } if (defined('PATH_TO_CERTIFICATES_FILE')) {