FIX: make RestfulServer:: configurable

This commit is contained in:
Andreas Piening 2018-04-04 12:54:18 +12:00
parent 4581fbf479
commit d45a407185

View File

@ -331,15 +331,15 @@ class RestfulServer extends Controller
// get formatter // get formatter
if (!empty($extension)) { if (!empty($extension)) {
$formatter = DataFormatter::for_extension($extension); $formatter = DataFormatter::for_extension($extension);
} elseif ($includeAcceptHeader && !empty($accept) && $accept != '*/*') { } elseif ($includeAcceptHeader && !empty($accept) && strpos($accept, '*/*') === false) {
$formatter = DataFormatter::for_mimetypes($mimetypes); $formatter = DataFormatter::for_mimetypes($mimetypes);
if (!$formatter) { if (!$formatter) {
$formatter = DataFormatter::for_extension(self::$default_extension); $formatter = DataFormatter::for_extension($this->config()->default_extension);
} }
} elseif (!empty($contentType)) { } elseif (!empty($contentType)) {
$formatter = DataFormatter::for_mimetype($contentType); $formatter = DataFormatter::for_mimetype($contentType);
} else { } else {
$formatter = DataFormatter::for_extension(self::$default_extension); $formatter = DataFormatter::for_extension($this->config()->default_extension);
} }
if (!$formatter) { if (!$formatter) {