implemented legacy download links

This commit is contained in:
2025-10-05 23:38:38 +02:00
parent f0384191d5
commit c56d17803e

View File

@@ -20,6 +20,14 @@ public class WebHandler extends BaseHandler {
@Override
public boolean doGet(Path path, HttpExchange ex) throws IOException {
LOG.log(DEBUG,"doGet({0},ex)",path);
// legacy download links: redirect to new api
if ("files/download".equals(path.toString())) {
var file = queryParam(ex).get("file");
var target = "/api/files/"+file;
return sendRedirect(ex,target);
}
// we always need to load the index.html first, when we encounter something like /module/entry/4/view
// the index page itself references required elements with absolute path: /assets/index-x.js
var first = path.isEmpty() ? null : path.firstElement();