jetty-9 gzip tests handle HTTP/1.0 EOF content

This commit is contained in:
Greg Wilkins 2012-08-27 13:35:31 +10:00
parent 54d6739879
commit 6e9bea1938
2 changed files with 8 additions and 3 deletions

View File

@ -32,6 +32,7 @@ import org.eclipse.jetty.servlet.DefaultServlet;
import org.eclipse.jetty.servlet.FilterHolder;
import org.eclipse.jetty.servlets.gzip.GzipTester;
import org.eclipse.jetty.toolchain.test.TestingDir;
import org.eclipse.jetty.util.log.Log;
import org.junit.Rule;
import org.junit.Test;
import org.junit.runner.RunWith;

View File

@ -290,9 +290,13 @@ public class GzipTester
Assert.assertThat("Response.status",response.getStatus(),is(status));
if (expectedFilesize != (-1))
{
Assert.assertThat("Response.header[Content-Length]",response.get("Content-Length"),notNullValue());
int serverLength = Integer.parseInt(response.get("Content-Length"));
Assert.assertThat("Response.header[Content-Length]",serverLength,is(expectedFilesize));
Assert.assertEquals(expectedFilesize,response.getContentBytes().length);
String cl=response.get("Content-Length");
if (cl!=null)
{
int serverLength = Integer.parseInt(response.get("Content-Length"));
Assert.assertEquals(serverLength,expectedFilesize);
}
}
Assert.assertThat("Response.header[Content-Encoding]",response.get("Content-Encoding"),not(containsString(compressionType)));
}