From faec7ad408cdb4433035ae6f793a9a1747efdc60 Mon Sep 17 00:00:00 2001 From: Vladimir Krivosheev Date: Tue, 12 Feb 2013 12:54:46 +0400 Subject: [PATCH] fix isSupported after last commit --- .../src/com/intellij/ide/XmlRpcServerImpl.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/platform/platform-impl/src/com/intellij/ide/XmlRpcServerImpl.java b/platform/platform-impl/src/com/intellij/ide/XmlRpcServerImpl.java index aa17b7806f69..eaf066b3bea0 100644 --- a/platform/platform-impl/src/com/intellij/ide/XmlRpcServerImpl.java +++ b/platform/platform-impl/src/com/intellij/ide/XmlRpcServerImpl.java @@ -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 handlers = new THashMap();