unsplash / unsplash-js

🤖 Official JavaScript wrapper for the Unsplash API
https://www.npmjs.com/package/unsplash-js
MIT License
2.14k stars 157 forks source link

Params are not URI encoded #205

Open OliverJAsh opened 1 year ago

OliverJAsh commented 1 year ago

Given:

unsplash.photos.get({ photoId: 'foo/bar' });

Expected: request to /photos/foo%2Fbar Actual: request to /photos/foo/bar

Note: some usages of getPathname rely on this behaviour:

https://github.com/unsplash/unsplash-web/blob/330bb40640c3e1d3600ecc5a1b15a244013f0c5a/app/services/api/Photo/index.ts#L36C1-L37

OliverJAsh commented 1 year ago

This most likely affects other endpoints, in addition to /photos.