fixed legacy redirects

Signed-off-by: Stephan Richter <s.richter@srsoftware.de>
This commit is contained in:
2025-08-18 14:37:43 +02:00
parent 090df72abe
commit 9aca5bd088
4 changed files with 8 additions and 4 deletions

View File

@@ -29,7 +29,8 @@ public class CompanyLegacy extends BaseHandler {
@Override
public boolean doGet(Path path, HttpExchange ex) throws IOException {
if (path.empty()) return sendRedirect(ex, url(ex).replaceAll("/legacy/","/"));
var url = url(ex);
if (path.empty() || url.endsWith("/view")) return sendRedirect(ex, url.replaceAll("/legacy/","/"));
return super.doGet(path, ex);
}

View File

@@ -33,7 +33,8 @@ public class NotesLegacy extends BaseHandler {
@Override
public boolean doGet(Path path, HttpExchange ex) throws IOException {
if (path.empty()) return sendRedirect(ex, url(ex).replaceAll("/legacy/","/"));
var url = url(ex);
if (path.empty() || url.endsWith("/view")) return sendRedirect(ex, url.replaceAll("/legacy/","/"));
return super.doGet(path, ex);
}

View File

@@ -34,7 +34,8 @@ public class ProjectLegacy extends BaseHandler {
@Override
public boolean doGet(Path path, HttpExchange ex) throws IOException {
if (path.empty()) return sendRedirect(ex, url(ex).replaceAll("/legacy/","/"));
var url = url(ex);
if (path.empty() || url.endsWith("/view")) return sendRedirect(ex, url.replaceAll("/legacy/","/"));
return super.doGet(path, ex);
}

View File

@@ -33,7 +33,8 @@ public class TaskLegacy extends BaseHandler {
@Override
public boolean doGet(Path path, HttpExchange ex) throws IOException {
if (path.empty()) return sendRedirect(ex, url(ex).replaceAll("/legacy/","/"));
var url = url(ex);
if (path.empty() || url.endsWith("/view")) return sendRedirect(ex, url.replaceAll("/legacy/","/"));
return super.doGet(path, ex);
}