You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
getAdapter method should became public to let adapters like axios-mock-adapter access http / xhr known adapters #5474
libraries like axios-mock-adapter define an adapter but in same cases need to access to original adapter.
It was working correctly before as the adapter was always a function.
Now it can be an array of string
Only the method getAdapter() in adapters/adapter.js can allow access to original adapters (xhr and http)
But this method is not exported a all at top level.
Can you export it ?
To Reproduce
Try to use axios-mock-adapter plugin with onNoMatch option
Code snippet
No response
Expected behavior
No response
Axios Version
1.2.1 and upper
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
No response
OS
No response
Additional Library Versions
No response
Additional context/Screenshots
No response
Reacted by Alok Vishwakarma, JD Solanki, Mihai, Jakka Prihatna, Roman Kuzkokov, aden-74, Mark Hughes, Homa Wong, Nick E, Viktor Zozuliak and 2 more
I would also appreciate this. I have a custom adapter that wraps the default one, but it is unusable with the latest axios releases due to it being impossible to access the default adapters.
Activity
mogzol commentedon Jan 21, 2023
I would also appreciate this. I have a custom adapter that wraps the default one, but it is unusable with the latest axios releases due to it being impossible to access the default adapters.
unional commentedon Feb 10, 2023
The http adapter is also needed to workaround an issue for jsdom: https://stackoverflow.com/questions/51054286/cross-origin-http-request-originating-from-server-side-nodejs-axios-jsdom
Currently it is not exposed and with
exportsfield we can't even force our way in usingdeclare module 'axios/lib/adapters/http'for TypeScript.UPDATE: that issue can be fixed by
axios.defaults.adapter = 'http'