From f3f676d2a93d93dc1599ef60150d58915b364442 Mon Sep 17 00:00:00 2001 From: Stephan Vock Date: Thu, 19 Dec 2024 11:17:17 +0000 Subject: [PATCH] Allow redirect responses to output warnings/infos --- src/Composer/Util/Http/CurlDownloader.php | 2 +- src/Composer/Util/RemoteFilesystem.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Composer/Util/Http/CurlDownloader.php b/src/Composer/Util/Http/CurlDownloader.php index 1cdae6df9..0216597d2 100644 --- a/src/Composer/Util/Http/CurlDownloader.php +++ b/src/Composer/Util/Http/CurlDownloader.php @@ -426,7 +426,7 @@ class CurlDownloader } fclose($job['bodyHandle']); - if ($response->getStatusCode() >= 400 && $response->getHeader('content-type') === 'application/json') { + if ($response->getStatusCode() >= 300 && $response->getHeader('content-type') === 'application/json') { HttpDownloader::outputWarnings($this->io, $job['origin'], json_decode($response->getBody(), true)); } diff --git a/src/Composer/Util/RemoteFilesystem.php b/src/Composer/Util/RemoteFilesystem.php index cafdee213..1e9630190 100644 --- a/src/Composer/Util/RemoteFilesystem.php +++ b/src/Composer/Util/RemoteFilesystem.php @@ -304,7 +304,7 @@ class RemoteFilesystem if (!empty($http_response_header[0])) { $statusCode = self::findStatusCode($http_response_header); - if ($statusCode >= 400 && Response::findHeaderValue($http_response_header, 'content-type') === 'application/json') { + if ($statusCode >= 300 && Response::findHeaderValue($http_response_header, 'content-type') === 'application/json') { HttpDownloader::outputWarnings($this->io, $originUrl, json_decode($result, true)); }