Skip to content
This repository was archived by the owner on Jul 22, 2023. It is now read-only.

Commit 641781a

Browse files
authored
Merge pull request #11 from brammittendorff/hotfix/fixed-path-collapsing
Fixed path collapsing for S3 and Rackspace
2 parents 8892ca0 + 47b2b30 commit 641781a

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/Adapter/Rackspace.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -41,8 +41,9 @@ public static function create($url)
4141

4242
$options = (array) $url->query;
4343

44-
$container = trim(\arc\path::head($url->path), '/');
45-
$prefix = ltrim(\arc\path::tail($url->path), '/');
44+
$path = \arc\path::collapse($url->path);
45+
$container = trim(\arc\path::head($path), '/');
46+
$prefix = ltrim(\arc\path::tail($path), '/');
4647

4748
$client = new OpenStack($auth, $args, $options);
4849
$store = $client->objectStoreService('swift', $zone);

src/Adapter/S3.php

+3-2
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,9 @@ public static function create($url)
4949
$args = static::buildArgs($url);
5050
$client = S3Client::factory($args);
5151

52-
$bucket = (string) \arc\path::head($url->path);
53-
$subpath = (string) \arc\path::tail($url->path);
52+
$path = \arc\path::collapse($url->path);
53+
$bucket = (string) \arc\path::head($path);
54+
$subpath = (string) \arc\path::tail($path);
5455
return static::buildAdapter($client, $bucket, $subpath);
5556
}
5657
}

0 commit comments

Comments
 (0)