fix isSupported after last commit

This commit is contained in:
Vladimir Krivosheev
2013-02-12 13:21:50 +04:00
parent 1c059d3fef
commit faec7ad408
@@ -80,7 +80,7 @@ public class XmlRpcServerImpl implements XmlRpcServer {
static final class XmlRpcRequestHandler extends HttpRequestHandler {
@Override
public boolean isSupported(HttpRequest request) {
return request == HttpMethod.POST || request == HttpMethod.OPTIONS;
return request.getMethod() == HttpMethod.POST || request.getMethod() == HttpMethod.OPTIONS;
}
@Override
@@ -103,7 +103,7 @@ public class XmlRpcServerImpl implements XmlRpcServer {
}
private boolean process(QueryStringDecoder urlDecoder, HttpRequest request, ChannelHandlerContext context) throws IOException {
if (!(urlDecoder.getPath().isEmpty() || urlDecoder.getPath().equals("/") || urlDecoder.getPath().equalsIgnoreCase("/RPC2"))) {
if (!isXmlRpcRequest(urlDecoder.getPath())) {
return false;
}
@@ -138,6 +138,10 @@ public class XmlRpcServerImpl implements XmlRpcServer {
return false;
}
private static boolean isXmlRpcRequest(String path) {
return path.isEmpty() || (path.length() == 1 && path.charAt(0) == '/') || path.equalsIgnoreCase("/RPC2");
}
private static class XmlRpcHandlerMappingImpl implements XmlRpcHandlerMapping {
protected final THashMap<String, Object> handlers = new THashMap<String, Object>();