From 9859859f1082d94e546aa75746867df127aa0d9e Mon Sep 17 00:00:00 2001 From: Jordi Boggiano Date: Mon, 17 Aug 2015 15:57:00 +0100 Subject: [PATCH] Add comment, fixes #4145 --- src/Composer/Util/RemoteFilesystem.php | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index edcc465c7..12ec0fbfc 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -227,6 +227,8 @@ class RemoteFilesystem if (preg_match('{^content-encoding: *gzip *$}i', $header)) { $decode = true; } elseif (preg_match('{^HTTP/}i', $header)) { + // In case of redirects, http_response_headers contains the headers of all responses + // so we reset the flag when a new response is being parsed as we are only interested in the last response $decode = false; } }