Default to schema response part in LeftAndMain->schema()

More of a standard API approach to return data by default, and make customisation
via HTTP headers an optional mode.
This commit is contained in:
Ingo Schommer 2016-03-23 14:32:14 +13:00
parent adbcddee80
commit c3a8159e80

View File

@ -231,13 +231,8 @@ class LeftAndMain extends Controller implements PermissionProvider {
$validHeaderValues = ['schema', 'state'];
return in_array(trim($value), $validHeaderValues);
});
}
if (!count($schemaParts)) {
throw new SS_HTTPResponse_Exception(
'Invalid request. Check you\'ve set a "X-Formschema-Request" header with "schema" or "state" values.',
400
);
} else {
$schemaParts = ['schema'];
}
$return = ['id' => $form->getName()];