cloudinary-community / netlify-plugin-cloudinary

Supercharge images on your Netlify site with Cloudinary!
https://netlify.cloudinary.dev/
MIT License
42 stars 18 forks source link

[Bug] Netlify CLI local build on Windows results in Cloundinary URLs with %5C #100

Closed gshel closed 11 months ago

gshel commented 1 year ago

Bug Report

Describe the bug

If a user is running Netlify CLI local development env (netlify deploy --build) on Windows, generated Cloudinary URLs will contain %5C.

Is this a regression?

Nope!

Steps To Reproduce the error

must be on windows

  1. cd into the root directory of a linked netlify site's repo
  2. Verify that your netlify.toml enables the cloudinary integration and does not specify imagesPath
  3. Build Netlify locally:
    netlify deploy --build
  4. Look for section netlify-plugin-cloudinary (onBuild event) in the build logs

Expected behaviour

The redirects should always contain / since they are for a URI, not a file path. In the case of Windows, I would expect the \ which is then escaped to \\ to be replaced with /

CodeSandbox or Live Example of Bug

  1. Check out my branch locally
  2. cd to tests dir
  3. npx vitest

Screenshot or Video Recording

image

I wrote new tests to confirm the bug image

Your environment

Additional context

I'm trying to do Netlify CLI local development and noticed that the Cloudinary URLs looked wonky. As someone on Windows, I'd like to be able to contribute to this project and make sure the tests run as expected.