in impl/src/main/java/org/apache/peeco/impl/PeecoUtils.java [65:93]
public static HttpHandlerInfo getMatchingHandler(HttpRequest nettyRequest, List<HttpHandlerInfo> infos) throws RuntimeException
{
List<HttpHandlerInfo> matchings = new ArrayList<>();
for (HttpHandlerInfo info : infos)
{
String handlerUrl = info.annotation.url();
String incomingUrl = nettyRequest.uri();
if (isMatching(info.annotation.matching(), handlerUrl, incomingUrl)
&& Arrays.asList(info.annotation.method()).contains(mapHttpMethod(nettyRequest.method())))
{
if (info.annotation.matching() == Matching.EXACT)
{
return info;
}
matchings.add(info);
}
}
if (matchings.size() > 1)
{
throw new RuntimeException("Multiple HttpHandlers were found for the incoming Netty Request URI: " + nettyRequest.uri() +
". Only one method is allowed.");
}
return matchings.isEmpty() ? null : matchings.get(0);
}