Skip to content

Commit 048c865

Browse files
committed
Fix two leftover tasks regarding default URI building
1 parent 7d82fc3 commit 048c865

File tree

1 file changed

+3
-8
lines changed

1 file changed

+3
-8
lines changed

Classes/AbsTarget.php

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
use MicrosoftAzure\Storage\Blob\Models\ListBlobsOptions;
2121
use MicrosoftAzure\Storage\Blob\Models\SetBlobPropertiesOptions;
2222
use MicrosoftAzure\Storage\Common\Exceptions\ServiceException;
23+
use MicrosoftAzure\Storage\Common\Internal\Resources;
2324
use Neos\Error\Messages\Error;
2425
use Neos\Flow\Annotations as Flow;
2526
use Neos\Flow\Log\Utility\LogEnvironment;
@@ -416,10 +417,7 @@ private function publishCollectionFromDifferentAzureBlobStorage(CollectionInterf
416417
public function getPublicStaticResourceUri($relativePathAndFilename): string
417418
{
418419
$relativePathAndFilename = $this->encodeRelativePathAndFilenameForUri($relativePathAndFilename);
419-
# TODO Use configured name
420-
# https://<accountname>.blob.core.windows.net/
421-
$accountName = 'neosadaptortest';
422-
return sprintf('https://%s.blob.core.windows.net/%s/%s%s', $accountName, $this->containerName, $this->keyPrefix, $relativePathAndFilename);
420+
return sprintf('https://%s.%s/%s/%s%s', $this->blobService->getAccountName(), Resources::BLOB_BASE_DNS_NAME, $this->containerName, $this->keyPrefix, $relativePathAndFilename);
423421
}
424422

425423
/**
@@ -497,10 +495,7 @@ public function getPublicPersistentResourceUri(PersistentResource $resource): st
497495
$customUri = $this->persistentResourceUriPattern;
498496
if (empty($customUri)) {
499497
if (empty($baseUri)) {
500-
# TODO Use configured name
501-
# https://<accountname>.blob.core.windows.net/
502-
$accountName = 'neosadaptortest';
503-
$baseUri = sprintf('https://%s.blob.core.windows.net/', $accountName);
498+
$baseUri = sprintf('https://%s.%s/', $this->blobService->getAccountName(), Resources::BLOB_BASE_DNS_NAME);
504499
$customUri = '{baseUri}{containerName}/{keyPrefix}{sha1}/{filename}';
505500
} else {
506501
$customUri = self::DEFAULT_PERSISTENT_RESOURCE_URI_PATTERN;

0 commit comments

Comments
 (0)