From 60b43cc1b4f3ae268283211aa0b90963c6ab79c5 Mon Sep 17 00:00:00 2001 From: Luca Frosini Date: Mon, 26 Sep 2022 12:18:58 +0200 Subject: [PATCH] Fixing docs --- src/main/java/org/gcube/gcat/rest/docs/ApiDocs.java | 5 ++--- src/main/java/org/gcube/gcat/rest/docs/Docs.java | 7 ++----- 2 files changed, 4 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/gcube/gcat/rest/docs/ApiDocs.java b/src/main/java/org/gcube/gcat/rest/docs/ApiDocs.java index cc44290..af181c5 100644 --- a/src/main/java/org/gcube/gcat/rest/docs/ApiDocs.java +++ b/src/main/java/org/gcube/gcat/rest/docs/ApiDocs.java @@ -23,18 +23,17 @@ public class ApiDocs { private static Logger logger = LoggerFactory.getLogger(ApiDocs.class); @GET -// @Path("{any: .*}") public InputStream toDoc(@Context HttpServletRequest req) throws WebApplicationException { logger.trace("Called method to redirect to api-docs/index.html"); String pathInfo = req.getPathInfo(); try { - if (pathInfo.endsWith("api-docs")) { + if (pathInfo.endsWith("/api-docs")) { pathInfo += "/index.html"; } - if (pathInfo.endsWith("api-docs/")) { + if (pathInfo.endsWith("/api-docs/")) { pathInfo += "index.html"; } diff --git a/src/main/java/org/gcube/gcat/rest/docs/Docs.java b/src/main/java/org/gcube/gcat/rest/docs/Docs.java index 6f3d3a2..7134cf8 100644 --- a/src/main/java/org/gcube/gcat/rest/docs/Docs.java +++ b/src/main/java/org/gcube/gcat/rest/docs/Docs.java @@ -21,22 +21,19 @@ import org.slf4j.LoggerFactory; public class Docs { private static Logger logger = LoggerFactory.getLogger(Docs.class); - - @GET -// @Path("{any: .*}") public InputStream toDoc(@Context HttpServletRequest req) throws WebApplicationException { logger.trace("Called method to redirect to docs/index.html"); String pathInfo = req.getPathInfo(); try { - if (pathInfo.endsWith("docs")) { + if (pathInfo.endsWith("/docs")) { pathInfo += "/index.html"; } - if (pathInfo.endsWith("docs/")) { + if (pathInfo.endsWith("/docs/")) { pathInfo += "index.html"; }