From 453602958966edc0d54b056e031f0acf6f247f0e Mon Sep 17 00:00:00 2001 From: Andrew Summers <18727110+summersab@users.noreply.github.com> Date: Tue, 29 Aug 2023 18:13:44 -0500 Subject: Refactor `OC\Server::getHTTPClientService` Signed-off-by: Andrew Summers <18727110+summersab@users.noreply.github.com> --- lib/private/legacy/OC_Util.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'lib/private/legacy') diff --git a/lib/private/legacy/OC_Util.php b/lib/private/legacy/OC_Util.php index 9d62c46137e..9d06a4d2e61 100644 --- a/lib/private/legacy/OC_Util.php +++ b/lib/private/legacy/OC_Util.php @@ -67,6 +67,7 @@ use bantu\IniGetWrapper\IniGetWrapper; use OC\Files\SetupManager; use OCP\Files\Template\ITemplateManager; +use OCP\Http\Client\IClientService; use OCP\IConfig; use OCP\IGroupManager; use OCP\IURLGenerator; @@ -942,7 +943,7 @@ class OC_Util { // accessing the file via http $url = \OC::$server->getURLGenerator()->getAbsoluteURL(OC::$WEBROOT . '/data' . $fileName); try { - $content = \OC::$server->getHTTPClientService()->newClient()->get($url)->getBody(); + $content = \OC::$server->get(IClientService::class)->newClient()->get($url)->getBody(); } catch (\Exception $e) { $content = false; } @@ -954,7 +955,7 @@ class OC_Util { } try { - $fallbackContent = \OC::$server->getHTTPClientService()->newClient()->get($url)->getBody(); + $fallbackContent = \OC::$server->get(IClientService::class)->newClient()->get($url)->getBody(); } catch (\Exception $e) { $fallbackContent = false; } -- cgit v1.2.3