if ($semicolon = mb_strpos($mimetype, ';')) {
$mimetype = mb_substr($mimetype, 0, $semicolon);
}
- return $mimetype;
+ return trim($mimetype);
}
function common_mime_type_match($type, $avail)
throw new Exception('Unexpected HTTP status code.');
}
- switch ($response->getHeader('content-type')) {
+ switch (common_bare_mime($response->getHeader('content-type'))) {
case self::JRD_MIMETYPE_OLD:
case self::JRD_MIMETYPE:
$type = 'json';
break;
default:
// fall back to letting XML_XRD auto-detect
- common_debug('No recognized content-type header for resource descriptor body.');
+ common_debug('No recognized content-type header for resource descriptor body on '._ve($xrd_uri));
$type = null;
}
$xrd->loadString($response->getBody(), $type);