spatie / laravel-google-cloud-storage

Google Cloud Storage filesystem driver for Laravel
https://spatie.be/open-source
MIT License
196 stars 51 forks source link

Use 'url' config for the base public path #21

Closed lucacri closed 2 years ago

lucacri commented 2 years ago

In our production environment, we use custom domains for the GCS buckets. Unfortunately, using the apiEndpoint configuration variable (only for the $file->url(), aka only the display part), it gives the following error:

<?xml version='1.0' encoding='UTF-8'?><Error><Code>InvalidAuthentication</Code><Message>The provided authentication header is invalid.</Message><Details>Cannot use OAuth Authorization header with form POST.</Details></Error>

Replacing it with url in the config allows to use a different setting when we only want to use a different domain for the public url, while still using the regular DEFAULT_API_ENDPOINT = 'https://storage.googleapis.com'; for the upload.

In this PR, I added a new configuration variable url which is only used for the generation of the link.

freekmurze commented 2 years ago

Closing due to inactivity.