arthurfiorette / axios-cache-interceptor

📬 Small and efficient cache interceptor for axios. Etag, Cache-Control, TTL, HTTP headers and more!
https://axios-cache-interceptor.js.org
MIT License
699 stars 58 forks source link

CORS errors when using axios-cache-interceptor #563

Closed mmoore99 closed 1 year ago

mmoore99 commented 1 year ago

I am attempting to add axios-cache-interceptor to a web app that is using axios and has been working fine without any cache functionality. When I activate axios-cache-interceptor I am getting CORS errors that I do not get when axios-cache-interceptor is not activated. An example of the error is as follows: Access to XMLHttpRequest at 'https://api.themoviedb.org/3/tv/13335/watch/providers?cache-buster=1686948751542' from origin 'https://fiddleshows.ngrok.io' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource.

I would appreciate any guidance as to how to resolve this issue as it only occurs when axios-cache-interceptor is activated.

I am using Axios 1.4.0 and axios-cache-interceptor 1.2.0.

arthurfiorette commented 1 year ago

Does #471 solve your issue?

mmoore99 commented 1 year ago

Does https://github.com/arthurfiorette/axios-cache-interceptor/issues/471 solve your issue?

Yes, that does solve the issue. Thanks for your speedy response.