Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions src/matchers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -211,15 +211,15 @@ impl PathExactMatcher {
);
}

if let Ok(url) = Url::parse(&path)
&& let Some(host) = url.host_str()
{
panic!(
"Wiremock can't match the path `{}` because it contains the host `{}`. You don't have to specify the host - wiremock knows it. Try replacing your path with `path(\"{}\")`",
path,
host,
url.path()
);
if let Ok(url) = Url::parse(&path) {
if let Some(host) = url.host_str() {
panic!(
"Wiremock can't match the path `{}` because it contains the host `{}`. You don't have to specify the host - wiremock knows it. Try replacing your path with `path(\"{}\")`",
path,
host,
url.path()
);
}
}

// Prepend "/" to the path if missing.
Expand Down