Fix js minification url

This commit is contained in:
Timothy Warren 2017-12-04 15:57:13 -05:00
parent 98c24d4704
commit 63fe8684c4

View File

@ -18,7 +18,7 @@ namespace Aviat\EasyMin;
use function Amp\wait; use function Amp\wait;
use Amp\Artax\{Client, FormBody, Request}; use Amp\Artax\{Client, FormBody, Request};
use Aviat\Ion\Json; use Aviat\Ion\{Json, JsonException};
// Include Amp and Artax // Include Amp and Artax
require_once('../vendor/autoload.php'); require_once('../vendor/autoload.php');
@ -121,7 +121,7 @@ class JSMin {
$request = (new Request) $request = (new Request)
->setMethod('POST') ->setMethod('POST')
->setUri('http://closure-compiler.appspot.com/compile') ->setUri('https://closure-compiler.appspot.com/compile')
->setAllHeaders([ ->setAllHeaders([
'Accept' => 'application/json', 'Accept' => 'application/json',
'Accept-Encoding' => 'gzip', 'Accept-Encoding' => 'gzip',
@ -143,6 +143,8 @@ class JSMin {
* @return void * @return void
*/ */
protected function checkMinifyErrors($options) protected function checkMinifyErrors($options)
{
try
{ {
$errorRes = $this->closureCall($options); $errorRes = $this->closureCall($options);
$errorJson = $errorRes->getBody(); $errorJson = $errorRes->getBody();
@ -158,6 +160,12 @@ class JSMin {
die(); die();
} }
} }
catch (JsonException $e)
{
print_r($e);
die();
}
}
/** /**
* Get Files * Get Files