Replace the session variable being queried to determine if a forced redirect to https is needed.
This commit is contained in:
Terry Brady
2013-08-29 12:24:06 -04:00
parent 1b1cdd0b7e
commit 9fdbbf790d

View File

@@ -257,7 +257,7 @@ public class DSpaceCocoonServletFilter implements Filter
realResponse.sendRedirect(locationWithTrailingSlash); realResponse.sendRedirect(locationWithTrailingSlash);
} }
// if force ssl is on and the user has authenticated and the request is not secure redirect to https // if force ssl is on and the user has authenticated and the request is not secure redirect to https
else if ((ConfigurationManager.getBooleanProperty("xmlui.force.ssl")) && (realRequest.getSession().getAttribute("dspace.current.user.id")!=null) && (!realRequest.isSecure())) { else if ((ConfigurationManager.getBooleanProperty("xmlui.force.ssl")) && (realRequest.getSession().getAttribute("dspace.user.effective")!=null) && (!realRequest.isSecure())) {
StringBuffer location = new StringBuffer("https://"); StringBuffer location = new StringBuffer("https://");
location.append(ConfigurationManager.getProperty("dspace.hostname")).append(realRequest.getContextPath()).append(realRequest.getServletPath()).append( location.append(ConfigurationManager.getProperty("dspace.hostname")).append(realRequest.getContextPath()).append(realRequest.getServletPath()).append(
realRequest.getQueryString() == null ? "" realRequest.getQueryString() == null ? ""