From 7baba29d9d9a34dcc2ac050963cbf0d50f0f4567 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 25 Nov 2024 12:39:53 +0700 Subject: [PATCH 1/3] [ticket/17443] Increase Guzzle client request timeout for version checks PHPBB-17443 --- phpBB/phpbb/version_helper.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/version_helper.php b/phpBB/phpbb/version_helper.php index 3e11c3419e4..4844c6e62ec 100644 --- a/phpBB/phpbb/version_helper.php +++ b/phpBB/phpbb/version_helper.php @@ -381,7 +381,7 @@ public function get_versions($force_update = false, $force_cache = false) } else if ($info === false || $force_update) { - $info = $this->file_downloader->get($this->host, $this->path, $this->file, $this->use_ssl ? 443 : 80); + $info = $this->file_downloader->get($this->host, $this->path, $this->file, $this->use_ssl ? 443 : 80, 30); $error_string = $this->file_downloader->get_error_string(); if (!empty($error_string)) From 253579761d95be031f4265a004873c13e36d7019 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 25 Nov 2024 13:30:33 +0700 Subject: [PATCH 2/3] [ticket/17443] Fix HTTP 403 response to Guzzle client requests for some hosts PHPBB-17443 --- phpBB/phpbb/file_downloader.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/phpBB/phpbb/file_downloader.php b/phpBB/phpbb/file_downloader.php index 14607ece0c8..c73983f464d 100644 --- a/phpBB/phpbb/file_downloader.php +++ b/phpBB/phpbb/file_downloader.php @@ -51,6 +51,10 @@ protected function create_client(string $host, int $port = 443, int $timeout = 6 return new Client([ 'base_uri' => $host, 'timeout' => $timeout, + 'headers' => [ + 'user-agent' => 'phpBB/' . PHPBB_VERSION, + 'accept' => 'text/html,application/xhtml+xml,application/xml' + ], ]); } From 13945f56a9daf89e5e87b87257c62d89da142aa9 Mon Sep 17 00:00:00 2001 From: rxu Date: Mon, 25 Nov 2024 16:06:44 +0700 Subject: [PATCH 3/3] [ticket/17443] Use default */* accept header (like curl etc) PHPBB-17443 --- phpBB/phpbb/file_downloader.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/phpBB/phpbb/file_downloader.php b/phpBB/phpbb/file_downloader.php index c73983f464d..0dcb3e58543 100644 --- a/phpBB/phpbb/file_downloader.php +++ b/phpBB/phpbb/file_downloader.php @@ -53,7 +53,7 @@ protected function create_client(string $host, int $port = 443, int $timeout = 6 'timeout' => $timeout, 'headers' => [ 'user-agent' => 'phpBB/' . PHPBB_VERSION, - 'accept' => 'text/html,application/xhtml+xml,application/xml' + 'accept' => '*/*', ], ]); }