BUGFIX: Select correct default data formatter in restfulserver when there's an apparently useful Accept header that doesn't actually match a data formatter{

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/2.3@75034 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Sam Minnee 2009-04-23 05:21:44 +00:00
parent 7cea3a6a1b
commit 953973b331

View File

@ -292,6 +292,7 @@ class RestfulServer extends Controller {
$formatter = DataFormatter::for_extension($extension);
}elseif($includeAcceptHeader && !empty($accept) && $accept != '*/*') {
$formatter = DataFormatter::for_mimetypes($mimetypes);
if(!$formatter) $formatter = DataFormatter::for_extension(self::$default_extension);
} elseif(!empty($contentType)) {
$formatter = DataFormatter::for_mimetype($contentType);
} else {