Merge remote-tracking branch 'origin/jetty-9.3.x' into jetty-9.4.x

This commit is contained in:
Greg Wilkins 2016-09-09 09:10:48 +10:00
commit ebec811427
2 changed files with 2 additions and 3 deletions

View File

@ -578,7 +578,7 @@ public class Server extends HandlerWrapper implements Attributes
// this is a dispatch with a path
ServletContext context=event.getServletContext();
String query=baseRequest.getQueryString();
baseRequest.setURIPathQuery(URIUtil.addPaths(context==null?null:context.getContextPath(), path));
baseRequest.setURIPathQuery(URIUtil.addPaths(context==null?null:URIUtil.encodePath(context.getContextPath()), path));
HttpURI uri = baseRequest.getHttpURI();
baseRequest.setPathInfo(uri.getDecodedPath());
if (uri.getQuery()!=null)

View File

@ -136,8 +136,7 @@ public class EncodedURITest
{
String response = _connector.getResponse("GET /context%20path/test%20servlet/path%20info?async=true&wrap=true HTTP/1.0\n\n");
assertThat(response,startsWith("HTTP/1.1 200 "));
// TODO this contextPath should be encoded
assertThat(response,Matchers.containsString("requestURI=/context path/test%20servlet/path%20info"));
assertThat(response,Matchers.containsString("requestURI=/context%20path/test%20servlet/path%20info"));
assertThat(response,Matchers.containsString("servletPath=/test servlet"));
assertThat(response,Matchers.containsString("contextPath=/context path"));
assertThat(response,Matchers.containsString("pathInfo=/path info"));