Browse Source

implemented legacy download links

module/projects
Stephan Richter 4 weeks ago
parent
commit
c56d17803e
  1. 8
      web/src/main/java/de/srsoftware/umbrella/web/WebHandler.java

8
web/src/main/java/de/srsoftware/umbrella/web/WebHandler.java

@ -20,6 +20,14 @@ public class WebHandler extends BaseHandler { @@ -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();

Loading…
Cancel
Save