Replace contains() with indexOf()

Closes gh-11373
This commit is contained in:
Johnny Lim
2017-12-19 00:22:35 +09:00
committed by Stephane Nicoll
parent 544c40d46d
commit 4cc598ac5e
5 changed files with 10 additions and 9 deletions

View File

@@ -303,8 +303,9 @@ public class ServerProperties {
public String getServletPrefix() {
String result = this.path;
if (result.contains("*")) {
result = result.substring(0, result.indexOf("*"));
int index = result.indexOf("*");
if (index != -1) {
result = result.substring(0, index);
}
if (result.endsWith("/")) {
result = result.substring(0, result.length() - 1);