Skip to content

Commit

Permalink
Fix closure-compiler's error "redirection limit reached". fixes #618, #…
Browse files Browse the repository at this point in the history
…619

Merge branch 'v2.x-pr-618' into 2.x
  • Loading branch information
glensc committed Nov 3, 2017
2 parents 2c83b82 + e4ba869 commit 1928e89
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions HISTORY.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
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)
* PHP 7.1 compatibility fix. #600

Expand Down
5 changes: 4 additions & 1 deletion min/lib/Minify/JS/ClosureCompiler.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class Minify_JS_ClosureCompiler {
/**
* @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
Expand Down Expand Up @@ -172,6 +172,9 @@ protected function getResponse($postBody)
$contents = file_get_contents($this->serviceUrl, false, stream_context_create(array(
'http' => array(
'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",
'content' => $postBody,
'max_redirects' => 0,
Expand Down

0 comments on commit 1928e89

Please sign in to comment.