Make Jetty context path handling less restrictive
[lgpl/argeo-commons.git] / org.argeo.cms.lib.jetty / src / org / argeo / cms / jetty / JettyHttpServer.java
index 11cce74cdc2e1b50a0b8294fa0b30a8d61a27c45..d393e4b2b28b402ffbe2af1c5dcb514c8b691c7a 100644 (file)
@@ -241,10 +241,10 @@ public class JettyHttpServer extends HttpsServer {
 
        @Override
        public synchronized HttpContext createContext(String path) {
+               if (!path.endsWith("/"))
+                       path = path + "/";
                if (contexts.containsKey(path))
                        throw new IllegalArgumentException("Context " + path + " already exists");
-               if (!path.endsWith("/"))
-                       throw new IllegalArgumentException("Path " + path + " should end with a /");
 
                JettyHttpContext httpContext = new ServletHttpContext(this, path);
                contexts.put(path, httpContext);