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

This commit is contained in:
Joakim Erdfelt 2018-11-02 11:07:39 -05:00
commit 0912c58cdb
3 changed files with 30 additions and 3 deletions

15
Jenkinsfile vendored
View File

@ -36,7 +36,6 @@ def getFullBuild(jdk, os, mainJdk) {
sh "mvn -V -B install -Dmaven.test.failure.ignore=true -T5 -e -Djetty.testtracker.log=true -Pmongodb -Dunix.socket.tmp=" + env.JENKINS_HOME
// Javadoc only
sh "mvn -V -B javadoc:javadoc -T6 -e -Dmaven.test.failure.ignore=false"
}
}
@ -77,6 +76,20 @@ def getFullBuild(jdk, os, mainJdk) {
step([$class : 'WarningsPublisher',
consoleParsers: consoleParsers])
}
/* Deprecated in Jetty build, will be removed in future.
stage ("Compact3 - ${jdk}") {
withMaven(
maven: mvnName,
jdk: "$jdk",
publisherStrategy: 'EXPLICIT',
globalMavenSettingsConfig: settingsName,
mavenOpts: mavenOpts,
mavenLocalRepo: localRepo) {
sh "mvn -f aggregates/jetty-all-compact3 -V -B -Pcompact3 clean install -T6"
}
}
*/
}
}
}

View File

@ -226,7 +226,7 @@ public class ResourceService
String pathInContext=URIUtil.addPaths(servletPath,pathInfo);
boolean endsWithSlash=(pathInfo==null?servletPath:pathInfo).endsWith(URIUtil.SLASH);
boolean endsWithSlash=(pathInfo==null?(_pathInfoOnly?"":servletPath):pathInfo).endsWith(URIUtil.SLASH);
boolean checkPrecompressedVariants=_precompressedFormats.length > 0 && !endsWithSlash && !included && reqRanges==null;
HttpContent content=null;
@ -373,7 +373,7 @@ public class ResourceService
throws ServletException, IOException
{
// Redirect to directory
if (!endsWithSlash || (pathInContext.length()==1 && request.getAttribute("org.eclipse.jetty.server.nullPathInfo")!=null))
if (!endsWithSlash)
{
StringBuffer buf=request.getRequestURL();
synchronized(buf)

View File

@ -555,6 +555,14 @@ public class DefaultServletTest
altholder.setInitParameter("welcomeServlets", "false");
altholder.setInitParameter("gzip", "false");
ServletHolder otherholder = context.addServlet(DefaultServlet.class, "/other/*");
otherholder.setInitParameter("resourceBase", altRoot.toUri().toASCIIString());
otherholder.setInitParameter("pathInfoOnly", "true");
otherholder.setInitParameter("dirAllowed", "true");
otherholder.setInitParameter("redirectWelcome", "false");
otherholder.setInitParameter("welcomeServlets", "false");
otherholder.setInitParameter("gzip", "false");
ServletHolder defholder = context.addServlet(DefaultServlet.class, "/");
defholder.setInitParameter("dirAllowed", "false");
defholder.setInitParameter("redirectWelcome", "false");
@ -567,6 +575,12 @@ public class DefaultServletTest
String rawResponse;
HttpTester.Response response;
// Test other redirect
rawResponse = connector.getResponse("GET /context/other HTTP/1.0\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);
assertThat(response.toString(), response.getStatus(), is(HttpStatus.MOVED_TEMPORARILY_302));
assertThat(response, containsHeaderValue("Location", "http://0.0.0.0/context/other/"));
// Test alt default
rawResponse = connector.getResponse("GET /context/alt/dir/ HTTP/1.0\r\n\r\n");
response = HttpTester.parseResponse(rawResponse);