[Dive4elements-commits] [PATCH 1 of 2] Be sure that a redirect url always exist

Wald Commits scm-commit at wald.intevation.org
Thu Nov 8 10:47:33 CET 2012


# HG changeset patch
# User Björn Ricks <bjoern.ricks at intevation.de>
# Date 1352366949 -3600
# Node ID 0074c113bb957049f75977f2528600bb99364dc0
# Parent  f3c4976874f2224306426e0ba22b5651a2513e13
Be sure that a redirect url always exist

When redirecting the user after a successful authentication be sure that the url
is valid.

diff -r f3c4976874f2 -r 0074c113bb95 flys-client/src/main/java/de/intevation/flys/client/server/LoginServlet.java
--- a/flys-client/src/main/java/de/intevation/flys/client/server/LoginServlet.java	Wed Nov 07 15:58:03 2012 +0100
+++ b/flys-client/src/main/java/de/intevation/flys/client/server/LoginServlet.java	Thu Nov 08 10:29:09 2012 +0100
@@ -21,6 +21,7 @@
 public class LoginServlet extends HttpServlet {
 
     private static Logger logger = Logger.getLogger(LoginServlet.class);
+    private static final String FLYS_PAGE = "FLYS.html";
 
     private void redirectFailure(HttpServletResponse resp, String path)
         throws IOException {
@@ -41,7 +42,9 @@
             String uri) throws IOException {
         if (uri == null) {
             String redirecturl = getServletContext().getInitParameter("redirect-url");
-
+            if (redirecturl == null) {
+                redirecturl = FLYS_PAGE;
+            }
             uri = "/" + redirecturl;
         }
         resp.sendRedirect(uri);


More information about the Dive4elements-commits mailing list