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

[Bug] Encoding error on src with Cloudinary url #219

Closed
gastMor opened this issue Jun 21, 2023 · 4 comments · Fixed by #232
Closed

[Bug] Encoding error on src with Cloudinary url #219

gastMor opened this issue Jun 21, 2023 · 4 comments · Fixed by #232
Labels

Comments

@gastMor
Copy link

gastMor commented Jun 21, 2023

Bug Report

Describe the bug

I use on component CldImage this src:
https://res.cloudinary.com/dcrteccot/image/upload/v1683130473/tour/1/No%20usada%202.jpg

and I got this response that brokes the image:
https://res.cloudinary.com/dcrteccot/image/upload/c_limit,w_300/f_auto/q_auto/v1683130473/tour/1/No%2520usada%25202?_a=BAVAS0DV0

Steps To Reproduce the error

  1. Use CldImage component
  2. Add on src prop "https://res.cloudinary.com/dcrteccot/image/upload/v1683130473/tour/1/No%20usada%202.jpg"

Screenshot or Video Recording

Captura de Pantalla 2023-06-21 a la(s) 00 41 53 Captura de Pantalla 2023-06-21 a la(s) 00 42 16

Additional context

I think this is an issue related to a second encoding of the Cloudinary Image

@colbyfayock
Copy link
Collaborator

thanks @gastMor for the report

it looks like this is actually an issue with a dependency i'm using for URL creation: https://www.npmjs.com/package/@cloudinary/url-gen

I'll see what I can do to mitigate this, but have been able to reproduce

as far as usage is concerned so i can better understand the use case, is that URL coming back to your programmatically with the encoding already on the URL?

@colbyfayock
Copy link
Collaborator

im thinking a solution here could be proactively decoding the public ID of any passed in value with the idea being the dependency re-encodes it. this would prevent the double encoding. if there are no encoded characters, it would be harmless

going to think on it a bit more to see if any special cases come up before moving forward with this

colbyfayock added a commit that referenced this issue Jul 18, 2023
# Description

- Fixes issue with double encoding
cloudinary-community/cloudinary-util#60

- Fixes issue where signature was not allowing special characters `-_`
cloudinary-community/cloudinary-util#61

## Issue Ticket Number

Fixes #219 

<!-- Specify above which issue this fixes by referencing the issue
number (`#<ISSUE_NUMBER>`) or issue URL. -->
<!-- Example: Fixes
https://github.com/colbyfayock/next-cloudinary/issues/<ISSUE_NUMBER> -->

## Type of change

<!-- Please select all options that are applicable. -->

- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing
functionality to not work as expected)
- [ ] Fix or improve the documentation
- [ ] This change requires a documentation update


# Checklist

<!-- These must all be followed and checked. -->

- [ ] I have followed the contributing guidelines of this project as
mentioned in [CONTRIBUTING.md](/CONTRIBUTING.md)
- [ ] I have created an
[issue](https://github.com/colbyfayock/next-cloudinary/issues) ticket
for this PR
- [ ] I have checked to ensure there aren't other open [Pull
Requests](https://github.com/colbyfayock/next-cloudinary/pulls) for the
same update/change?
- [ ] I have performed a self-review of my own code
- [ ] I have run tests locally to ensure they all pass
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have made corresponding changes needed to the documentation
@github-actions
Copy link

🎉 This issue has been resolved in version 4.15.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

github-actions bot pushed a commit that referenced this issue Jul 18, 2023
# [4.15.0](v4.14.1...v4.15.0) (2023-07-18)

### Features

* Fixes encoding and missing signature characters ([#232](#232)) ([4b520ce](4b520ce)), closes [#219](#219)
@colbyfayock
Copy link
Collaborator

hey @gastMor if you get to trying this, please let me know if you notice any issues!

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

Successfully merging a pull request may close this issue.

2 participants