LukeMathWalker / LukeMathWalker/wiremock-rs

Panic if the `path` matcher receives as input a URL with a host

Open
#106 1 comment 0 reactions 0 assignees View on GitHub
good first issue
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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.