diff src/org/eclipse/jetty/server/handler/ContextHandler.java @ 1013:6939226e0ac4

simplify URIUtil
author Franklin Schmidt <fschmidt@gmail.com>
date Mon, 24 Oct 2016 01:06:33 -0600
parents 32d4b569567c
children 2b769da7f67d
line wrap: on
line diff
--- a/src/org/eclipse/jetty/server/handler/ContextHandler.java	Mon Oct 24 00:47:24 2016 -0600
+++ b/src/org/eclipse/jetty/server/handler/ContextHandler.java	Mon Oct 24 01:06:33 2016 -0600
@@ -170,9 +170,9 @@
 				// context request must end with /
 				request.setHandled(true);
 				if (request.getQueryString() != null)
-					response.sendRedirect(URIUtil.addPaths(request.getRequestURI(),URIUtil.SLASH) + "?" + request.getQueryString());
+					response.sendRedirect(URIUtil.addPaths(request.getRequestURI(),"/") + "?" + request.getQueryString());
 				else
-					response.sendRedirect(URIUtil.addPaths(request.getRequestURI(),URIUtil.SLASH));
+					response.sendRedirect(URIUtil.addPaths(request.getRequestURI(),"/"));
 				return false;
 			}
 		}
@@ -203,12 +203,12 @@
 			}
 			else if (_contextPath.length() == 1)
 			{
-				target = URIUtil.SLASH;
-				pathInfo = URIUtil.SLASH;
+				target = "/";
+				pathInfo = "/";
 			}
 			else
 			{
-				target = URIUtil.SLASH;
+				target = "/";
 				pathInfo = null;
 			}
 		}
@@ -316,7 +316,7 @@
 
 	public Resource getResource(String path) throws MalformedURLException
 	{
-		if (path == null || !path.startsWith(URIUtil.SLASH))
+		if (path == null || !path.startsWith("/"))
 			throw new MalformedURLException(path);
 
 		if (_baseResource == null)
@@ -348,8 +348,8 @@
 
 			if (resource != null && resource.exists())
 			{
-				if (!path.endsWith(URIUtil.SLASH))
-					path = path + URIUtil.SLASH;
+				if (!path.endsWith("/"))
+					path = path + "/";
 
 				String[] l = resource.list();
 				if (l != null)