Split off content type comments
[shpub.git] / src / shpub / Request.php
index 3614d5d69100ff4b1d5a92e25a6da58233068c44..dce163f42a2c51f470cb9fe13000b262f4cec9fe 100644 (file)
@@ -108,7 +108,7 @@ class Request
         );
 
         $shown = false;
-        if ($res->getHeader('content-type') == 'application/json') {
+        if (Util::getMimeType($res) == 'application/json') {
             $errData = json_decode($res->getBody());
             if (!isset($errData->error)) {
                 Log::err('Error response does not contain "error" property');
@@ -225,7 +225,7 @@ class Request
     {
         if ($isHtml) {
             $this->addProperty(
-                'content', ['html' => $text]
+                'content', [['html' => $text]]
             );
         } else {
             $this->addProperty('content', $text);