Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Secure Delivery File Transformations Not Working #186

Closed
AlexJezior opened this issue Jan 31, 2022 · 4 comments
Closed

Secure Delivery File Transformations Not Working #186

AlexJezior opened this issue Jan 31, 2022 · 4 comments
Labels

Comments

@AlexJezior
Copy link
Contributor

Describe the bug

Following the documentation found here for image transformations.

When providing a transformation, the URL generated gives a 403 error.

To reproduce, the following is being used: $api->file()->generateSecureUrl('/'.$img->uuid.'/-/preview/150x150/-/enhance/25/-/sharp/');

When viewing the output URL, you can observe extra forward slashes being used in the URL:
https://cdn.mysite.com//{UUID}/-/preview/150x150/-/enhance/25/-/sharp//?token=exp={TIMESTAMP}~acl=//{UUID}/-/preview/150x150/-/enhance/25/-/sharp//~hmac={TOKEN}

This also results in a 403 error with the extra sashes(/):
$api->file()->generateSecureUrl('/'.$img->uuid.'/');

This returns successful:
$api->file()->generateSecureUrl("$img->uuid");

Expected behavior

Expect transformations to work per documentation example:
$api->file()->generateSecureUrl('/{uuid}/-/resize/640x/other/transformations/');

Code / screenshots

Examples provided in description above.

Environment

  • Library version: 3.1.1
  • Language/framework version: PHP 7.4 / Laravel 8.61.0
  • OS version: Debian 10 buster
@rsedykh
Copy link
Member

rsedykh commented Feb 7, 2022

Thank you Alex for your PR! Update is released — https://github.com/uploadcare/uploadcare-php/releases/tag/v3.2.1.

@rsedykh rsedykh closed this as completed Feb 7, 2022
@AlexJezior
Copy link
Contributor Author

AlexJezior commented Feb 8, 2022

Thanks for merging this promptly!

However, I noticed the 3.2.1 tag does not include this fix. Looks like it made it into the development branch.

@rsedykh
Copy link
Member

rsedykh commented Feb 9, 2022

Oops. Created tag from a wrong branch. I've just published a new release — https://github.com/uploadcare/uploadcare-php/releases/tag/v3.2.1. Now should be latest and greatest!

@AlexJezior
Copy link
Contributor Author

Thank you!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

No branches or pull requests

2 participants