Fix build for windows: gzip encoding has different response length
@@ -9,7 +9,9 @@ import java.io.IOException;
import java.util.Scanner;
import java.util.zip.GZIPInputStream;
+import static java.util.stream.LongStream.range;
import static org.junit.jupiter.api.Assertions.assertEquals;
+import static org.junit.jupiter.api.Assertions.assertTrue;
public class Issue1656 {
@@ -27,7 +29,7 @@ public class Issue1656 {
if (len == -1) {
assertEquals("chunked", rsp.header("Transfer-Encoding"));
} else {
- assertEquals(63, rsp.body().contentLength());
+ assertTrue(range(63, 66).anyMatch(value -> value == rsp.body().contentLength()));
}
assertEquals("gzip", rsp.header("content-encoding"));
assertEquals("(function () { console.log('ready');})();", ungzip(body.bytes()).trim());
