mirror of
https://github.com/silverstripe/silverstripe-restfulserver
synced 2024-10-22 14:05:58 +02:00
FIX: make RestfulServer:: configurable
This commit is contained in:
parent
4581fbf479
commit
d45a407185
@ -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) {
|
||||||
|
Loading…
Reference in New Issue
Block a user