LukeMathWalker / LukeMathWalker/wiremock-rs
Panic if the `path` matcher receives as input a URL with a host
- Dominant language
- Rust
- Stars
- 799
- Forks
- 91
- PR merge metrics
- No merged PRs in 30d
Description
I have bumped into users trying the following:
```rust
Mock::given(path("https://domain.com/abcd"));
```
with an expectation that it will match incoming requests for `/abcd`.
In reality, they should write:
```rust
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.
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the `path` matcher entry point and its existing tests. Reproduce the URL-with-host input, then verify that it panics with guidance toward the path-only form while inputs such as `/abcd` retain their current matching behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- testing
- Issue type
- Bug
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100