HBASE-6248 Jetty init may fail if directory name contains "master" (Dave Revell)

git-svn-id: https://svn.apache.org/repos/asf/hbase/trunk@1352395 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
Zhihong Yu 2012-06-21 02:18:25 +00:00
parent fec5ef0f98
commit 6e5c615355
1 changed files with 5 additions and 3 deletions

View File

@ -125,8 +125,10 @@ public class InfoServer extends HttpServer {
// web applications.
final String master = "master";
String p = getWebAppsPath(master);
int index = p.lastIndexOf(master);
// Now strip master off the end if it is present
return index == -1? p: p.substring(0, index);
if(p.endsWith(master)) {
return p.substring(0, p.lastIndexOf(master));
}
return p;
}
}
}