Skip to content

Commit 31b93c6

Browse files
committed
Fix URL path
1 parent 06b1de4 commit 31b93c6

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

src/Adapter/ProtectedAdapter.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use League\Flysystem\AzureBlobStorage\AzureBlobStorageAdapter;
88
use MicrosoftAzure\Storage\Blob\BlobRestProxy;
99
use SilverStripe\Assets\Flysystem\ProtectedAdapter as SilverstripeProtectedAdapter;
10+
use SilverStripe\Control\Controller;
1011

1112
class ProtectedAdapter extends AzureBlobStorageAdapter implements SilverstripeProtectedAdapter
1213
{
@@ -60,7 +61,11 @@ public function setExpiry($expiry)
6061
*/
6162
public function getProtectedUrl($path)
6263
{
63-
throw new Exception('Not implemented yet');
64+
if ($meta = $this->getMetadata($path)) {
65+
return Controller::join_links(ASSETS_DIR, $meta['path']);
66+
}
67+
68+
return '';
6469
}
6570

6671
public function getVisibility($path)

src/Adapter/PublicAdapter.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
use League\Flysystem\AzureBlobStorage\AzureBlobStorageAdapter;
77
use MicrosoftAzure\Storage\Blob\BlobRestProxy;
88
use SilverStripe\Assets\Flysystem\PublicAdapter as SilverstripePublicAdapter;
9+
use SilverStripe\Control\Controller;
910

1011
class PublicAdapter extends AzureBlobStorageAdapter implements SilverstripePublicAdapter
1112
{
@@ -32,7 +33,7 @@ public function __construct($connectionUrl = '', $containerName = '')
3233
public function getPublicUrl($path)
3334
{
3435
if ($meta = $this->getMetadata($path)) {
35-
return $meta['url'];
36+
return Controller::join_links(ASSETS_DIR, $meta['path']);
3637
}
3738

3839
return '';

0 commit comments

Comments
 (0)