From bd58cc881492f5079e8ab3b8265daa72e4db8842 Mon Sep 17 00:00:00 2001 From: Lukas Winkler Date: Fri, 1 Jan 2021 01:13:29 +0100 Subject: always send an "Accept-Encoding" header with HTTP requests (#17009) * always send an "Accept-Encoding" header with HTTP requests * revert unrelated change * only use CURLOPT_ENCODING when not getting a range of bytes (so tests will pass) Co-authored-by: diosmosis --- core/Http.php | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'core') diff --git a/core/Http.php b/core/Http.php index 4377ebac7a..793371aa9f 100644 --- a/core/Http.php +++ b/core/Http.php @@ -608,6 +608,11 @@ class Http if ($rangeBytes) { curl_setopt($ch, CURLOPT_RANGE, $rangeBytes); + } else { + // see https://github.com/matomo-org/matomo/pull/17009 for more info + // NOTE: we only do this when CURLOPT_RANGE is not being used, because when using both the + // response is empty. + $curl_options[CURLOPT_ENCODING] = ""; } // Case core:archive command is triggering archiving on https:// and the certificate is not valid -- cgit v1.2.3