]> WPIA git - gigi.git/blobdiff - src/org/cacert/gigi/Gigi.java
Fixed / path
[gigi.git] / src / org / cacert / gigi / Gigi.java
index 8cc076e19e6a3839b7e409fb44d69d1033ef4b80..a96396db15b49760b970430a79758fbf5209742b 100644 (file)
@@ -23,6 +23,7 @@ import org.cacert.gigi.pages.Page;
 import org.cacert.gigi.pages.PolicyRedir;
 import org.cacert.gigi.pages.TestSecure;
 import org.cacert.gigi.pages.Verify;
+import org.cacert.gigi.pages.account.MailAdd;
 import org.cacert.gigi.pages.account.MailCertificates;
 import org.cacert.gigi.pages.account.MailOverview;
 import org.cacert.gigi.pages.account.MyDetails;
@@ -54,6 +55,7 @@ public class Gigi extends HttpServlet {
                pages.put(PolicyRedir.PATH, new PolicyRedir());
                pages.put(MailOverview.DEFAULT_PATH, new MailOverview(
                                "My email addresses"));
+               pages.put(MailAdd.DEFAULT_PATH, new MailAdd("Add new email"));
                String templ = "";
                try (BufferedReader reader = new BufferedReader(new InputStreamReader(
                                new FileInputStream(new File("templates/base.html"))))) {
@@ -113,7 +115,9 @@ public class Gigi extends HttpServlet {
 
        }
        private Page getPage(String pathInfo) {
-
+               if (pathInfo.endsWith("/") && !pathInfo.equals("/")) {
+                       pathInfo = pathInfo.substring(0, pathInfo.length() - 1);
+               }
                Page page = pages.get(pathInfo);
                if (page != null) {
                        return page;