Issue #2180111 by linclark: REST should not assume hal_json if no format is provided.

8.0.x
webchick 2014-01-24 19:57:58 -08:00
parent cc27945146
commit 9bbf4b9e34
1 changed files with 2 additions and 2 deletions

View File

@ -72,8 +72,8 @@ class RequestHandler extends ContainerAware {
// Invoke the operation on the resource plugin.
// All REST routes are restricted to exactly one format, so instead of
// parsing it out of the Accept headers again, we can simply retrieve the
// format requirement. If there is no format associated, just pick HAL.
$format = $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT)->getRequirement('_format') ?: 'hal_json';
// format requirement. If there is no format associated, just pick JSON.
$format = $request->attributes->get(RouteObjectInterface::ROUTE_OBJECT)->getRequirement('_format') ?: 'json';
try {
$response = $resource->{$method}($id, $unserialized, $request);
}