Skip to content

Public Temp URL for file download broken when URL type internal #648

@matt-in-a-hat

Description

@matt-in-a-hat

It looks like this was attempted to be fixed here #594 however it seems that this always results in 401 Unauthorized: Temp URL invalid because the URL doesn't have the container and file name in it.

As far as I can see if you use $forcePublicUrl below then it misses out on the extra things that DataObject::getUrl() adds to the URL path, namely the container and file name.
$url = ($forcePublicUrl === true) ? $this->getService()->getEndpoint()->getPublicUrl() : $this->getUrl();
(see https://github.com/rackspace/php-opencloud/blob/working/lib/OpenCloud/ObjectStore/Resource/DataObject.php#L484)

My work around for now is to ensure I instantiate the object store service with publicURL when wanting to generate temporary URLs for download.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions