braintree / sanitize-url

MIT License
307 stars 35 forks source link

Change to handling encoded parameters in 7.0.2 #75

Open shank-eric opened 1 month ago

shank-eric commented 1 month ago

Hello!

I recently upgraded from 7.0.1 to 7.0.2 and had a test fail due to a change in how encoded URL parameters are handled. For example, with 7.0.1 when I pass a URL like http://test.com?encodedParam=foo%2Fbar%2Fbaz into sanitizeUrl I get back http://test.com?encodedParam=foo%2Fbar%2Fbaz.

But with 7.0.2 when passing the same URL in, I now get back http://test.com?encodedParam=foo/bar/baz. I've created a little sample code sandbox here: https://codesandbox.io/p/sandbox/little-butterfly-4n6xzp?file=%2Fpackage.json%3A10%2C38. You can see the change in behavior by switching the version in the package.json in that sandbox.

I've reverted to 7.0.1 for now, but Is this an intended change?

animeshk874 commented 3 weeks ago

I've been facing something similar too. Might be related to this change here - https://github.com/braintree/sanitize-url/commit/6c15df9c76ed28efcca894c7c51510cae5af3fd8