diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/GzipTester.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/GzipTester.java index 9a16f333af4..c5a104a6856 100644 --- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/GzipTester.java +++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/GzipTester.java @@ -117,7 +117,11 @@ public class GzipTester // Assert the response headers Assert.assertThat("Response.method",response.getMethod(),nullValue()); // Assert.assertThat("Response.status",response.getStatus(),is(HttpServletResponse.SC_OK)); - Assert.assertThat("Response.header[Content-Length]",response.getHeader("Content-Length"),notNullValue()); + if ( response.getHeader("X-Testing-Skip-Content-Length") == null ) + { + Assert.assertThat("Response.header[Content-Length]",response.getHeader("Content-Length"),notNullValue()); + } + int qindex = compressionType.indexOf(";"); if (qindex < 0) Assert.assertThat("Response.header[Content-Encoding]",response.getHeader("Content-Encoding"),containsString(compressionType)); diff --git a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletStreamLengthTypeWriteWithFlush.java b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletStreamLengthTypeWriteWithFlush.java index 9d8e3fb7287..d1cd1b1067c 100644 --- a/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletStreamLengthTypeWriteWithFlush.java +++ b/jetty-servlets/src/test/java/org/eclipse/jetty/servlets/gzip/TestServletStreamLengthTypeWriteWithFlush.java @@ -54,7 +54,8 @@ public class TestServletStreamLengthTypeWriteWithFlush extends TestDirContentSer ServletOutputStream out = response.getOutputStream(); response.setContentLength(dataBytes.length); - + response.setHeader("X-Testing-Skip-Content-Length","true"); + if (fileName.endsWith("txt")) response.setContentType("text/plain"); else if (fileName.endsWith("mp3"))