414923 CompactPathRule needs to also compact the uri

This commit is contained in:
Jan Bartel 2013-08-13 10:54:28 +10:00
parent 891088e18a
commit d99e47830d
1 changed files with 4 additions and 3 deletions

View File

@ -23,8 +23,6 @@ import java.io.IOException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.eclipse.jetty.http.HttpURI;
import org.eclipse.jetty.http.PathMap;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.util.URIUtil;
@ -42,7 +40,10 @@ public class CompactPathRule extends Rule implements Rule.ApplyURI
@Override
public void applyURI(Request request, String oldTarget, String newTarget) throws IOException
{
request.setRequestURI(newTarget);
String uri = request.getRequestURI();
if (uri.startsWith("/"))
uri = URIUtil.compactPath(uri);
request.setRequestURI(uri);
}
@Override