Commit 9bbf4b9e authored by webchick's avatar webchick

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

parent cc279451
......@@ -72,8 +72,8 @@ public function handle(Request $request, $id = NULL) {
// 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);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment