cloudinary / js-url-gen

Cloudinary's base javascript library, including URL generation.
https://www.cloudinary.com
MIT License
47 stars 9 forks source link

fix: double encoding of commas in createCloudinaryURL #581

Closed Edjevw12 closed 1 year ago

Edjevw12 commented 1 year ago

fixes #580

Pull request for @cloudinary/url-gen

What does this PR solve?

double encoding of commas

Final checklist

Edjevw12 commented 1 year ago
 Tests for Encoding the URL › Should encode cloudinary characters (",") in a publicID
    expect(received).toBe(expected) // Object.is equality
    Expected: "https://res.cloudinary.com/demo/image/upload/sam%252Cple"
    Received: "https://res.cloudinary.com/demo/image/upload/sam%2Cple"
      20 |     const url = createNewImage('sam,ple')
      21 |       .toURL();
    > 22 |     expect(url).toBe('https://res.cloudinary.com/demo/image/upload/sam%252Cple');
         |                 ^
      23 |   });
      24 |

Seems like this is "expected" behaviour but causes 404s?

image