提交 5e6cbbe5 编写于 作者: K ken.lj 提交者: Ian Luo

check null for path before call rest server (#3665)

上级 70898ef7
......@@ -237,13 +237,17 @@ public class RestProtocol extends AbstractProxyProtocol {
*/
protected String getContextPath(URL url) {
String contextPath = url.getPath();
if (contextPath.equalsIgnoreCase(url.getParameter(Constants.INTERFACE_KEY))) {
if (contextPath != null) {
if (contextPath.equalsIgnoreCase(url.getParameter(Constants.INTERFACE_KEY))) {
return "";
}
if (contextPath.endsWith(url.getParameter(Constants.INTERFACE_KEY))) {
contextPath = contextPath.substring(0, contextPath.lastIndexOf(url.getParameter(Constants.INTERFACE_KEY)));
}
return contextPath.endsWith("/") ? contextPath.substring(0, contextPath.length() - 1) : contextPath;
} else {
return "";
}
if (contextPath.endsWith(url.getParameter(Constants.INTERFACE_KEY))) {
contextPath = contextPath.substring(0, contextPath.lastIndexOf(url.getParameter(Constants.INTERFACE_KEY)));
}
return contextPath.endsWith("/") ? contextPath.substring(0, contextPath.length() - 1) : contextPath;
}
protected class ConnectionMonitor extends Thread {
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册