From 31b0de2285c3355c10cf8db2c893e6bb7170d18f Mon Sep 17 00:00:00 2001 From: Joakim Erdfelt Date: Wed, 3 Apr 2019 17:12:26 -0500 Subject: [PATCH] Issue #3319 - Fixing listing output dir slash expectation from tests Signed-off-by: Joakim Erdfelt --- .../org/eclipse/jetty/util/resource/Resource.java | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java index 1ad9d3d625d..3dc80381c13 100644 --- a/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java +++ b/jetty-util/src/main/java/org/eclipse/jetty/util/resource/Resource.java @@ -692,22 +692,17 @@ public abstract class Resource implements ResourceFactory, Closeable { name = name.substring(slashIdx + 1); } + if (item.isDirectory() && !name.endsWith("/")) + { + name += URIUtil.SLASH; + } // Name buf.append(""); buf.append(deTag(name)); - if (item.isDirectory() && !path.endsWith("/")) - { - buf.append(URIUtil.SLASH); - } buf.append(" "); buf.append("");