summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMatthias Andreas Benkard <code@mail.matthias.benkard.de>2020-02-09 06:47:05 +0100
committerMatthias Andreas Benkard <code@mail.matthias.benkard.de>2020-02-09 06:47:05 +0100
commit521718d5ef2d7a18497bc525fb15d245f6827180 (patch)
tree7cca084c323dcd96365597be3f2a7a9371f3d5ab /src
parentc275812ffa1382f350c24cf3967aa3fc5cdebcdb (diff)
Wiki: Add top-level redirect to Home.
Change-Id: Ide7605daf4b86d71181875b25ca8a7fb747b0beb
Diffstat (limited to 'src')
-rw-r--r--src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java
index 0f7aa3f..090dafd 100644
--- a/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java
+++ b/src/main/java/eu/mulk/mulkcms2/benki/wiki/WikiResource.java
@@ -11,6 +11,8 @@ import io.quarkus.qute.TemplateInstance;
import io.quarkus.qute.api.ResourcePath;
import io.quarkus.security.Authenticated;
import io.quarkus.security.identity.SecurityIdentity;
+import java.net.URI;
+import java.net.URISyntaxException;
import java.time.OffsetDateTime;
import java.time.format.DateTimeFormatter;
import java.time.format.FormatStyle;
@@ -28,6 +30,9 @@ import javax.ws.rs.POST;
import javax.ws.rs.Path;
import javax.ws.rs.PathParam;
import javax.ws.rs.Produces;
+import javax.ws.rs.RedirectionException;
+import javax.ws.rs.core.Response;
+import javax.ws.rs.core.Response.Status;
import org.jboss.logging.Logger;
import org.jsoup.Jsoup;
import org.jsoup.safety.Whitelist;
@@ -55,6 +60,12 @@ public class WikiResource {
@Inject SecurityIdentity identity;
@GET
+ @Authenticated
+ public Response getRoot() throws URISyntaxException {
+ return Response.seeOther(new URI("/wiki/Home")).build();
+ }
+
+ @GET
@Path("/{pageName}")
@Produces(TEXT_HTML)
@Authenticated