mirror of
https://github.com/silverstripe/silverstripe-restfulserver
synced 2024-10-22 14:05:58 +02:00
Merge pull request #55 from catalyst/master
FIX: make RestfulServer:: configurable
This commit is contained in:
commit
49f12cb31d
@ -331,15 +331,15 @@ class RestfulServer extends Controller
|
||||
// get formatter
|
||||
if (!empty($extension)) {
|
||||
$formatter = DataFormatter::for_extension($extension);
|
||||
} elseif ($includeAcceptHeader && !empty($accept) && $accept != '*/*') {
|
||||
} elseif ($includeAcceptHeader && !empty($accept) && strpos($accept, '*/*') === false) {
|
||||
$formatter = DataFormatter::for_mimetypes($mimetypes);
|
||||
if (!$formatter) {
|
||||
$formatter = DataFormatter::for_extension(self::$default_extension);
|
||||
$formatter = DataFormatter::for_extension($this->config()->default_extension);
|
||||
}
|
||||
} elseif (!empty($contentType)) {
|
||||
$formatter = DataFormatter::for_mimetype($contentType);
|
||||
} else {
|
||||
$formatter = DataFormatter::for_extension(self::$default_extension);
|
||||
$formatter = DataFormatter::for_extension($this->config()->default_extension);
|
||||
}
|
||||
|
||||
if (!$formatter) {
|
||||
|
Loading…
Reference in New Issue
Block a user