Skip to content

Commit faa78c8

Browse files
authored
Merge pull request #60167 from nextcloud/enh/noid/allow-http-progressive-stream-response
failing tests not related according to Julien
2 parents a08fcaf + 04dc699 commit faa78c8

2 files changed

Lines changed: 6 additions & 4 deletions

File tree

lib/private/Http/Client/ClientService.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,9 +41,9 @@ public function __construct(
4141
}
4242

4343
#[\Override]
44-
public function newClient(): IClient {
45-
$handler = new CurlHandler();
46-
$stack = HandlerStack::create($handler);
44+
public function newClient(?callable $handler = null): IClient {
45+
$clientHandler = $handler ?? new CurlHandler();
46+
$stack = HandlerStack::create($clientHandler);
4747
if ($this->config->getSystemValueBool('dns_pinning', true)) {
4848
$stack->push($this->dnsPinMiddleware->addDnsPinning());
4949
}

lib/public/Http/Client/IClientService.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@
1616
*/
1717
interface IClientService {
1818
/**
19+
* @param ?callable $handler Handler that overrides the default CurlHandler
1920
* @return IClient
2021
* @since 8.1.0
22+
* @since 35.0.0 Added $handler optional param
2123
*/
22-
public function newClient(): IClient;
24+
public function newClient(?callable $handler = null): IClient;
2325
}

0 commit comments

Comments
 (0)