Fixing docs

This commit is contained in:
Luca Frosini 2022-09-26 12:18:58 +02:00
parent c0e731b01a
commit 60b43cc1b4
2 changed files with 4 additions and 8 deletions

View File

@ -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";
}

View File

@ -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";
}