Skip to content

Commit

Permalink
Merge pull request #492 from choomz/patch-1
Browse files Browse the repository at this point in the history
Update ExceptionController.php
  • Loading branch information
lsmith77 committed Jul 3, 2013
2 parents 6b8a879 + 4ce946c commit 985df97
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions Controller/ExceptionController.php
Expand Up @@ -176,12 +176,14 @@ protected function getStatusCode($exception)
*/
protected function getFormat(Request $request, $format)
{
$request->attributes->set('_format', $format);
$priorities = $this->container->getParameter('fos_rest.default_priorities');
$preferExtension = $this->container->getParameter('fos_rest.prefer_extension');
$formatNegotiator = $this->container->get('fos_rest.format_negotiator');

return $formatNegotiator->getBestFormat($request, $priorities, $preferExtension) ?: $format;
$format = $formatNegotiator->getBestFormat($request, $priorities, $preferExtension) ?: $format;
$request->attributes->set('_format', $format);

return $format;
}

/**
Expand Down

0 comments on commit 985df97

Please sign in to comment.