Skip to content

Commit d3ae987

Browse files
committed
adapt to guzzle api
1 parent 87d344f commit d3ae987

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

lib/private/Files/Storage/DAV.php

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,12 +454,15 @@ public function fopen(string $path, string $mode) {
454454
case 'rb':
455455
try {
456456
$auth = [$this->user, $this->password];
457+
$headers = [];
457458
if ($this->authType === BearerAuthAwareSabreClient::AUTH_BEARER) {
458-
$auth = [$this->user, '', 'bearer'];
459+
$auth = [];
460+
$headers = ['Authorization' => 'Bearer ' . $this->user];
459461
}
460462
$response = $this->httpClientService
461463
->newClient()
462464
->get($this->createBaseUri() . $this->encodePath($path), [
465+
'headers' => $headers,
463466
'auth' => $auth,
464467
'stream' => true,
465468
// set download timeout for users with slow connections or large files
@@ -608,13 +611,16 @@ protected function uploadFile(string $path, string $target): void {
608611
$source = fopen($path, 'r');
609612

610613
$auth = [$this->user, $this->password];
614+
$headers = [];
611615
if ($this->authType === BearerAuthAwareSabreClient::AUTH_BEARER) {
612-
$auth = [$this->user, '', 'bearer'];
616+
$auth = [];
617+
$headers = ['Authorization' => 'Bearer ' . $this->user];
613618
}
614619
$this->httpClientService
615620
->newClient()
616621
->put($this->createBaseUri() . $this->encodePath($target), [
617622
'body' => $source,
623+
'headers' => $headers,
618624
'auth' => $auth,
619625
// set upload timeout for users with slow connections or large files
620626
'timeout' => $this->timeout

0 commit comments

Comments
 (0)