Panic if the `path` matcher receives as input a URL with a host
LukeMathWalker opened this issue · 0 comments
LukeMathWalker commented
I have bumped into users trying the following:
Mock::given(path("https://domain.com/abcd"));
with an expectation that it will match incoming requests for /abcd
.
In reality, they should write:
Mock::given(path("/abcd"));
to achieve the desired outcome.
path
should panic if the input contains a host, with an helpful suggestion pointing at the right usage pattern.