-
-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Closed
Description
Describe the bug
Success and error response interceptors are called in the order they were added (as written in the docs), but response interceptors are called in revers order (the last added is called first).
To Reproduce
Code snippet
axios.interceptors.request.use((data) => {
console.log('request 0');
return data
})
axios.interceptors.request.use((data) => {
console.log('request 1');
return data
})
axios.interceptors.response.use((data) => {
console.log('response 0');
return data
})
axios.interceptors.response.use((data) => {
console.log('response 1');
return data
})
axios.get('https://cdnjs.cloudflare.com/ajax/libs/axios/1.3.5/axios.min.js')
Expected behavior
There should be consoled:
request 0
request 1
response 0
response 1
Axios Version
1.3.5
Adapter Version
No response
Browser
No response
Browser Version
No response
Node.js Version
No response
OS
iOS 16
Additional Library Versions
RN 0.71Additional context/Screenshots
I found it at v0.27 and take an update to 1.3.5 expecting fix. But it still alive.
It can be reproduced at RN and browser (I did not check node)Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels