Skip to content

Commit a253eef

Browse files
committed
ServletPath is never null but it might be zero length.
git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1716881 13f79535-47bb-0310-9956-ffa450edef68
1 parent 9e57d05 commit a253eef

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

java/org/apache/catalina/servlets/DefaultServlet.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -350,11 +350,11 @@ protected String getRelativePath(HttpServletRequest request) {
350350
}
351351

352352
StringBuilder result = new StringBuilder();
353-
if (servletPath != null) {
353+
if (servletPath.length() > 0) {
354354
result.append(servletPath);
355-
if (pathInfo != null) {
356-
result.append(pathInfo);
357-
}
355+
}
356+
if (pathInfo != null) {
357+
result.append(pathInfo);
358358
}
359359
if (result.length() == 0) {
360360
result.append('/');

0 commit comments

Comments
 (0)