-
-
Notifications
You must be signed in to change notification settings - Fork 731
Closed
Labels
DocsChanges related to the documentationChanges related to the documentation
Description
Bug Description
The doc states "The order of the interceptors matters. The first interceptor will be the first to be called."
undici/docs/docs/api/Dispatcher.md
Line 844 in 4ab315e
| > - The order of the interceptors matters. The first interceptor will be the first to be called. |
Reproducible By
const a = new Agent().compose([
(dispatch) => {
return (opts, handler) => {
console.log('interceptor 1');
return dispatch(opts, handler);
};
},
(dispatch) => {
return (opts, handler) => {
console.log('interceptor 2');
return dispatch(opts, handler);
};
},
]);
a.request({
origin: '127.0.0.1',
path: '/',
method: 'GET',
});Expected Behavior
It should print
interceptor 1
interceptor 2
but actually it prints
interceptor 2
interceptor 1
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
DocsChanges related to the documentationChanges related to the documentation