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

This commit is contained in:
Greg Wilkins 2017-10-17 14:08:36 +11:00
commit 0f8bf0a64f
4 changed files with 49 additions and 12 deletions

View File

@ -815,6 +815,7 @@ public class AnnotationParser
MultiException me = new MultiException(); MultiException me = new MultiException();
// TODO do not force version 8 once ASM can scan 9 // TODO do not force version 8 once ASM can scan 9
// TODO support a different target for quickstart generation
MultiReleaseJarFile jarFile = new MultiReleaseJarFile(jarResource.getFile(),8,false); MultiReleaseJarFile jarFile = new MultiReleaseJarFile(jarResource.getFile(),8,false);
jarFile.stream().forEach(e-> jarFile.stream().forEach(e->
{ {

View File

@ -106,6 +106,7 @@ public class RequestTest
_server.setHandler(_handler); _server.setHandler(_handler);
ErrorHandler errors = new ErrorHandler(); ErrorHandler errors = new ErrorHandler();
errors.setServer(_server);
errors.setShowStacks(true); errors.setShowStacks(true);
_server.addBean(errors); _server.addBean(errors);
_server.start(); _server.start();
@ -1400,6 +1401,42 @@ public class RequestTest
} }
@Test
public void testBadCookies() throws Exception
{
final ArrayList<Cookie> cookies = new ArrayList<>();
_handler._checker = new RequestTester()
{
@Override
public boolean check(HttpServletRequest request,HttpServletResponse response) throws IOException
{
javax.servlet.http.Cookie[] ca = request.getCookies();
if (ca!=null)
cookies.addAll(Arrays.asList(ca));
response.getOutputStream().println("Hello World");
return true;
}
};
String response;
cookies.clear();
response=_connector.getResponses(
"GET / HTTP/1.1\n"+
"Host: whatever\n"+
"Cookie: path=value\n" +
"Cookie: name=value\n" +
"Connection: close\n"+
"\n"
);
assertTrue(response.startsWith("HTTP/1.1 200 OK"));
assertEquals(1,cookies.size());
assertEquals("name", cookies.get(0).getName());
assertEquals("value", cookies.get(0).getValue());
}
@Ignore("No longer relevant") @Ignore("No longer relevant")
@Test @Test
public void testCookieLeak() throws Exception public void testCookieLeak() throws Exception

View File

@ -141,9 +141,10 @@ if proceedyn "Are you sure you want to release using above? (y/N)" n; then
# This is equivalent to 'mvn release:prepare' # This is equivalent to 'mvn release:prepare'
if proceedyn "Update project.versions for $VER_RELEASE? (Y/n)" y; then if proceedyn "Update project.versions for $VER_RELEASE? (Y/n)" y; then
mvn org.codehaus.mojo:versions-maven-plugin:2.1:set \ mvn org.codehaus.mojo:versions-maven-plugin:2.5:set \
-DoldVersion="$VER_CURRENT" \ -DoldVersion="$VER_CURRENT" \
-DnewVersion="$VER_RELEASE" -DnewVersion="$VER_RELEASE" \
-DprocessAllModules=true
fi fi
if proceedyn "Commit $VER_RELEASE updates? (Y/n)" y; then if proceedyn "Commit $VER_RELEASE updates? (Y/n)" y; then
git commit -a -m "Updating to version $VER_RELEASE" git commit -a -m "Updating to version $VER_RELEASE"

View File

@ -27,5 +27,3 @@
</servlet-mapping> </servlet-mapping>
</web-app> </web-app>