Description
When registering the same route with different HTTP methods, it seems that the latest registered route always takes precedence, no matter what HTTP method is used.
Steps to reproduce
First I register the same route twice, but on different methods.
dioAdapter.onGet(
'/settings',
(server) {
server.reply(
200,
'{"data": {"some": "settings"}}',
);
},
);
dioAdapter.onPatch(
'/settings',
(server) {
server.reply(
200,
'',
);
},
);
Then in my test I try to make the HTTP call:
But when I do that I get the second call from the patch callback whereas I would expect the get callback to be called instead.
Expected behavior
The adapter should only match the route if the HTTP method is the one being called.
Additional context
- http_mock_adapter: ^0.6.1
- Flutter 3.19.5
Description
When registering the same route with different HTTP methods, it seems that the latest registered route always takes precedence, no matter what HTTP method is used.
Steps to reproduce
First I register the same route twice, but on different methods.
Then in my test I try to make the HTTP call:
But when I do that I get the second call from the
patchcallback whereas I would expect thegetcallback to be called instead.Expected behavior
The adapter should only match the route if the HTTP method is the one being called.
Additional context