1
0
mirror of https://github.com/mrclay/minify.git synced 2025-01-17 05:08:14 +01:00

Fix closure-compiler's error "redirection limit reached". fixes #618, #619

Merge branch 'v2.x-pr-618' into 2.x
This commit is contained in:
Elan Ruusamäe 2017-11-03 23:02:20 +02:00
commit 1928e89208
2 changed files with 7 additions and 1 deletions

View File

@ -1,5 +1,8 @@
Minify Release History Minify Release History
Version 2.3.3 (2017-11-03)
* Fix closure-compiler's error "redirection limit reached". #618, #619
Version 2.3.2 (2017-06-09) Version 2.3.2 (2017-06-09)
* PHP 7.1 compatibility fix. #600 * PHP 7.1 compatibility fix. #600

View File

@ -53,7 +53,7 @@ class Minify_JS_ClosureCompiler {
/** /**
* @var string $url URL of compiler server. defaults to Google's * @var string $url URL of compiler server. defaults to Google's
*/ */
protected $serviceUrl = 'http://closure-compiler.appspot.com/compile'; protected $serviceUrl = 'https://closure-compiler.appspot.com/compile';
/** /**
* @var int $maxBytes The maximum JS size that can be sent to the compiler server in bytes * @var int $maxBytes The maximum JS size that can be sent to the compiler server in bytes
@ -172,6 +172,9 @@ class Minify_JS_ClosureCompiler {
$contents = file_get_contents($this->serviceUrl, false, stream_context_create(array( $contents = file_get_contents($this->serviceUrl, false, stream_context_create(array(
'http' => array( 'http' => array(
'method' => 'POST', 'method' => 'POST',
'compilation_level' => 'SIMPLE',
'output_format' => 'text',
'output_info' => 'compiled_code',
'header' => "Content-type: application/x-www-form-urlencoded\r\nConnection: close\r\n", 'header' => "Content-type: application/x-www-form-urlencoded\r\nConnection: close\r\n",
'content' => $postBody, 'content' => $postBody,
'max_redirects' => 0, 'max_redirects' => 0,