Query String parameters break the url matching
See original GitHub issueIf I stub an url like:
stubFor(get(urlMatching("/my/url"))
.willReturn(aResponse().withStatus(200)
.withBodyFile("my_.json")));
querying /my/url?param=value will not match that url and return a 404, but the logs and the error message it will show the stripped url (without the query string parameter).
So in the logs you see the test registering /my/url, and then a call to /my/url returning a 404.
The expected behavior should probably be to either:
- ignore the query string params when matching the urls
- take them into account but then update the 404 error to show the full url.
Issue Analytics
- State:
- Created 10 years ago
- Comments:6
Top Results From Across the Web
Query String parameters break the url matching #110 - GitHub
If I stub an url like: stubFor(get(urlMatching("/my/url")) .willReturn(aResponse().withStatus(200) .withBodyFile("my_.json"))); querying ...
Read more >Separate URL & Query String - RegExr
Matches any character except line breaks. * Quantifier. Match 0 or more of the preceding token. ) ? Quantifier. Match ...
Read more >Regex in URL Rewriting to match Querystring Parameter ...
I need some URLs to be matched against a couple of main querystring parmeter values no matter what order they appear in. For...
Read more >How to Use Query Strings and Parameters for Marketers
This is a guide on query strings and parameters for marketers. Learn how to use text in a URL (query strings) for UTM...
Read more >4 Ways to Get Value from Query string | by bitbug
The query string of the URL is in the form of key=value&key=value , therefore the value of a single key can be obtained...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
urlMatching() takes a regex. Try:
/my/url.*
Closing as 1.52 has query param matching.