Skip to content
This repository has been archived by the owner on Aug 3, 2024. It is now read-only.

getUrl($path) prints incorrect URL when prefix is defined in config #12

Closed
taka-oyama opened this issue Dec 19, 2018 · 2 comments · Fixed by #16
Closed

getUrl($path) prints incorrect URL when prefix is defined in config #12

taka-oyama opened this issue Dec 19, 2018 · 2 comments · Fixed by #16

Comments

@taka-oyama
Copy link

taka-oyama commented Dec 19, 2018

Having the prefix defined in config causes getUrl($path) to print it twice

$config = [
    'bucket' => 'mybucket',
    'prefix' => 'icon',
];

$adapater = new GoogleCloudStorageAdapter(null, $config);
$adapter->getUrl('test.txt');
// expected: https://storage.googleapis.com/mybucket/icon/test.txt
// actual:   https://storage.googleapis.com/mybucket/icon//icon/test.txt

This is probably because prepareBaseUrl() includes the prefix when it shouldn't.

@cedricziel
Copy link
Owner

Thanks for the report and your patience! :)

@taka-oyama
Copy link
Author

Thank you for the fix!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants