Skip to content

Commit

Permalink
Merge pull request #50 from matomo-org/follow-location-fix
Browse files Browse the repository at this point in the history
Regression: Wrong header is enabled only for GET.
  • Loading branch information
diosmosis committed Nov 6, 2019
2 parents 3a002c5 + 00c43be commit 172c68f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion PiwikTracker.php
Original file line number Diff line number Diff line change
Expand Up @@ -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')) {
Expand Down

0 comments on commit 172c68f

Please sign in to comment.