New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Regex matching fails in certain cases #2
Comments
I wrote an acceptance test: @Test
public void mappingMatchedWithGenericRegexUrl() {
String REGEX_URL_MAPPING_REQUEST =
"{ \n" +
" \"request\": { \n" +
" \"method\": \"GET\", \n" +
" \"urlPattern\": \"/.*\" \n" +
" }, \n" +
" \"response\": { \n" +
" \"body\": \"Matched!\" \n" +
" } \n" +
"} ";
testClient.addResponse(REGEX_URL_MAPPING_REQUEST);
WireMockResponse response = testClient.get("/api/something/this-should-match");
assertThat(response.statusCode(), is(200));
assertThat(response.content(), is("Matched!"));
} But that passes, I'll close it for now until I can successfully repro the bug. I also tried in my HTTP client to strip off the accept header but make sure the mapping required it, it didn't match but the log was different from what I was seeing. |
I'd suggest looking at your other mappings to make sure there isn't a higher priority one matching your request |
shrutikumar15
pushed a commit
to shrutikumar15/wiremock
that referenced
this issue
Aug 13, 2023
Adjust response-definition and stub-mapping/s schemas
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found some odd behavior
I would expect that to match. There is also a mapping for /api/.* that has a priority of 6 but the other mapping listed above has a priority of 1. So I don't think it is a precedence bug.
The text was updated successfully, but these errors were encountered: