Should fix the build
This commit is contained in:
@@ -280,16 +280,24 @@ public final class WireMockRestServiceServer {
|
|||||||
: request.getUrlPath());
|
: request.getUrlPath());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private String withoutBaseUrl(String url) {
|
||||||
|
int indexOfBaseUrl = url.indexOf(this.baseUrl);
|
||||||
|
if (indexOfBaseUrl == -1) {
|
||||||
|
return url;
|
||||||
|
}
|
||||||
|
return url.substring(indexOfBaseUrl + this.baseUrl.length() + 1);
|
||||||
|
}
|
||||||
|
|
||||||
private Matcher<String> requestMatcher(RequestPattern request) {
|
private Matcher<String> requestMatcher(RequestPattern request) {
|
||||||
return new TypeSafeMatcher<String>() {
|
return new TypeSafeMatcher<String>() {
|
||||||
@Override
|
@Override
|
||||||
protected boolean matchesSafely(String item) {
|
protected boolean matchesSafely(String item) {
|
||||||
if (request.getUrlMatcher() != null) {
|
if (request.getUrlPathPattern() != null) {
|
||||||
return request.getUrlMatcher().match(item).isExactMatch();
|
return Pattern.compile(request.getUrlPathPattern())
|
||||||
|
.matcher(withoutBaseUrl(item)).matches();
|
||||||
}
|
}
|
||||||
else if (request.getUrlPathPattern() != null) {
|
else if (request.getUrlMatcher() != null) {
|
||||||
return Pattern.compile(request.getUrlPathPattern()).matcher(item)
|
return request.getUrlMatcher().match(item).isExactMatch();
|
||||||
.matches();
|
|
||||||
}
|
}
|
||||||
else if (request.getUrlPattern() != null) {
|
else if (request.getUrlPattern() != null) {
|
||||||
return Pattern.compile(request.getUrlPattern()).matcher(item)
|
return Pattern.compile(request.getUrlPattern()).matcher(item)
|
||||||
|
|||||||
Reference in New Issue
Block a user