From 7b3eda29df647ca7b9a6db2c157f1276ff669775 Mon Sep 17 00:00:00 2001 From: David Jencks Date: Tue, 19 May 2009 22:18:46 +0000 Subject: [PATCH] Bug 277021 Fix FormAuthenticator to reconstitute original url more correctly git-svn-id: svn+ssh://dev.eclipse.org/svnroot/rt/org.eclipse.jetty/jetty/trunk@238 7e9141cc-0065-0410-87d8-b60c137991c4 --- .../security/authentication/FormAuthenticator.java | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java index 77d23fc2bad..75d1f334b07 100644 --- a/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java +++ b/jetty-security/src/main/java/org/eclipse/jetty/security/authentication/FormAuthenticator.java @@ -215,17 +215,15 @@ public class FormAuthenticator extends LoginAuthenticator if (mandatory) { // redirect to login page - if (request.getQueryString() != null) - uri += "?" + request.getQueryString(); - synchronized (session) { if (session.getAttribute(__J_URI)==null) - session.setAttribute(__J_URI, request.getScheme() + "://" - + request.getServerName() - + ":" - + request.getServerPort() - + URIUtil.addPaths(request.getContextPath(), uri)); + { + StringBuffer buf = request.getRequestURL(); + if (request.getQueryString() != null) + buf.append("?").append(request.getQueryString()); + session.setAttribute(__J_URI, buf.toString()); + } } if (_dispatch)