Fix accept header in crawler
[phinde.git] / src / phinde / Indexer.php
index 2e40ba9a4222c67087298d50b5a41b4abeb9322a..4885b7a9fb86e1cbbb09cda23806925e82f66adc 100644 (file)
@@ -4,8 +4,8 @@ namespace phinde;
 class Indexer
 {
     static $supportedTypes = array(
-        'application/xhtml+xml',
-        'text/html',
+        'application/xhtml+xml' => true,
+        'text/html'             => true,
     );
 
     public function run(Retrieved $retrieved)
@@ -16,7 +16,7 @@ class Indexer
 
         $mimetype = explode(';', $res->getHeader('content-type'))[0];
         if (!in_array($mimetype, static::$supportedTypes)) {
-            echo "MIME type not supported for indexing: $mimetype\n";
+            Log::info("MIME type not supported for indexing: $mimetype");
             return false;
         }