diff --git a/src/main/java/org/gcube/datatransfer/resolver/services/UriResolverDocs.java b/src/main/java/org/gcube/datatransfer/resolver/services/UriResolverDocs.java index da6ed26..bb4efa4 100644 --- a/src/main/java/org/gcube/datatransfer/resolver/services/UriResolverDocs.java +++ b/src/main/java/org/gcube/datatransfer/resolver/services/UriResolverDocs.java @@ -34,15 +34,15 @@ public class UriResolverDocs { public InputStream index(@Context HttpServletRequest req) throws WebApplicationException { logger.info(UriResolverDocs.class.getSimpleName() + " called"); - String requestURI = req.getRequestURI(); + String pathInfo = req.getPathInfo(); + logger.info("pathInfo {}", pathInfo); try { - if (requestURI == null) - requestURI = "/index.html"; + if (pathInfo.equals("docs")) + pathInfo += "/index.html"; - String pathInfo = req.getPathInfo(); - logger.info("pathInfo {}", pathInfo); - logger.info("request URI {}", requestURI); + logger.info("redirecting to {}", pathInfo); + logger.info("request URI {}", req.getRequestURI()); String realPath = req.getServletContext().getRealPath(pathInfo); return new FileInputStream(new File(realPath)); @@ -50,7 +50,7 @@ public class UriResolverDocs { if (!(e instanceof WebApplicationException)) { // UNEXPECTED EXCEPTION managing it as WebApplicationException - String error = requestURI + " not found. Please, contact the support!"; + String error = pathInfo + " not found. Please, contact the support!"; throw ExceptionManager.internalErrorException(req, error, this.getClass(), null); } // ALREADY MANAGED AS WebApplicationException