diff --git a/src/Plugin/ProxifyPlugin.php b/src/Plugin/ProxifyPlugin.php index 15bd964..cc617d4 100644 --- a/src/Plugin/ProxifyPlugin.php +++ b/src/Plugin/ProxifyPlugin.php @@ -131,10 +131,11 @@ public function onCompleted(ProxyEvent $event){ $response = $event['response']; $str = $response->getContent(); - $content_type = $response->headers->get('content-type'); + $content_type = strtolower(trim($response->headers->get('content-type'))); // DO NOT do any proxification on .js files - if($content_type == 'text/javascript' || $content_type == 'application/javascript' || $content_type == 'application/x-javascript'){ + $types = array('text/javascript', 'application/javascript', 'application/x-javascript'); + if(in_array($content_type, $types)){ return; } @@ -176,4 +177,4 @@ public function onCompleted(ProxyEvent $event){ } -?> \ No newline at end of file +?>