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
  • Loading branch information
glensc committed Nov 3, 2017
2 parents 004f6bf + d9b392c commit 9ed7f9d
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion lib/Minify/JS/ClosureCompiler.php
Expand Up @@ -54,7 +54,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 @@ -174,6 +174,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 9ed7f9d

Please sign in to comment.