From 5f2c54f63634fa4c8ca5f869840998dfe1c22049 Mon Sep 17 00:00:00 2001 From: Steve Clay Date: Tue, 29 Sep 2015 16:29:21 -0400 Subject: [PATCH] Builder checks encoding problems with bigger response Fixes #347 --- builder/index.php | 6 +++++- builder/ocCheck.php | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/builder/index.php b/builder/index.php index dc98240..560b35b 100644 --- a/builder/index.php +++ b/builder/index.php @@ -187,7 +187,11 @@ by Minify. E.g. @import "/min/?g=css2";< var url = 'ocCheck.php?' + (new Date()).getTime(); $.get(url, function (ocStatus) { $.get(url + '&hello=1', function (ocHello) { - if (ocHello != 'World!') { + var expected = []; + for (var i = 0; i < 500; i++) { + expected.push('0123456789'); + } + if (ocHello != expected.join('')) { msg += 'It appears output is being automatically compressed, interfering ' + ' with Minify\'s own compression. '; if (ocStatus == '1') diff --git a/builder/ocCheck.php b/builder/ocCheck.php index ff991e4..799a632 100644 --- a/builder/ocCheck.php +++ b/builder/ocCheck.php @@ -24,8 +24,8 @@ if (isset($_GET['hello'])) { HTTP_Encoder::$encodeToIe6 = true; // just in case $he = new HTTP_Encoder(array( - 'content' => 'World!' - ,'method' => 'deflate' + 'content' => str_repeat('0123456789', 500), + 'method' => 'deflate', )); $he->encode(); $he->sendAll();