-
-
Notifications
You must be signed in to change notification settings - Fork 51
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Incorrect URL is being built when using relative paths. #161
Comments
Yes, but not in the current way. :p These changes should only be kept within the scope of the keyGenerator. Fixing it... |
Tested it and everything worked as intended. I'll release 0.9.3 tomorrow. If everything seems good, can you close this issue? |
Awesome Thanks @arthurfiorette |
Thanks @arthurfiorette. |
Hi,
In my application I have the backend serve a static page at a specific path
/clients/index.html
and client api root is/clients/api
Once the
/clients/index.html
is loaded, I need to get client information using the end point/clients/api/info
.I am using express for the backend and react for the frontend leveraging
axios
along with theaxios-cache-interceptor
.However when using the
axios
instance (decorated bysetupCache
) with thebaseURL
set to : '/clients/api' and the reqeust url set to/info
, I am noticing a 404 error in the console.Page URL: http://localhost:3010/clients/index.html
Clients Information Endpoint: http://localhost:3010/clients/api/info
Working code:
**Failing code: **
I have debugged the code and see that the issue occurs because of this line:
axios-cache-interceptor/src/util/key-generator.ts
Line 49 in dc27cd5
Any specific reason for trimming the slashes from the
baseURL
andurl
?The repo @ https://github.com/Chandu/axios-cache-interceptor-relative-base-path-issue can be used to reproduce the issue (I haven't used react in this repo for simpler setup, but the error can be reproduced ).
Screenshot showing the code/error
The text was updated successfully, but these errors were encountered: