Skip to content

Commit

Permalink
Merge pull request #16 from rchodava/logging-fixes
Browse files Browse the repository at this point in the history
Fix erroneous logging about which request is matched
  • Loading branch information
rchodava committed Mar 14, 2016
2 parents c83543c + bb42117 commit dc02eaf
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,12 @@ public MethodAndUriMatcher(Method method, String pattern, Route route) {

@Override
public boolean matches(ServerRequest request) {
return matchesMethod(request) && matchesUri(request);
boolean matches = matchesMethod(request) && matchesUri(request);
if (matches) {
logger.debug("Request matched {} {}", method, uriTemplate == null ? "*" : uriTemplate);
}

return matches;
}

private boolean matchesUri(ServerRequest request) {
Expand All @@ -42,13 +47,11 @@ private boolean matchesUri(ServerRequest request) {
((ServerRequestImpl) request).setUriParameters(uriParameters);
}

logger.debug("Request matched {} {}", method, uriTemplate);
return true;
} else {
return false;
}
} else {
logger.debug("Request matched {} *", method);
return true;
}
}
Expand Down

0 comments on commit dc02eaf

Please sign in to comment.