apiUrl not respected in browser app
djfdev opened this issue · 2 comments
djfdev commented
Steps to Reproduce
- Create an unsplash instance with proxy URL:
const unsplash = createApi({
apiUrl: 'http://localhost:4000/proxy'
})
- Call some method
unsplash.search.getPhotos({
query: 'cats'
})
Observed Behaviour
HTTP request goes directly to Unsplash:
Expected Behaviour
Request should go to my proxy at the specified apiUrl
, not directly to unsplash.
Technical Notes
- v7.0.2
- Potentially related to fix for #154
samijaber commented
I can't reproduce. I tested in here https://stackblitz.com/edit/unsplash-js-example-api-url?file=index.tsx with the same apiUrl
you provide, and I can see it in the logs that the request goes to the proxy URL and not to api.unsplash.com
. If you can show me a way to reproduce then I can help.
djfdev commented
Apologies, I just updated Chrome and this is working as expected with my example code shared above. Thanks for taking a look.