Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Commit

Permalink
Merge branch 'feature/view-strategy-aggregate'
Browse files Browse the repository at this point in the history
  • Loading branch information
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/Strategy/JsonStrategy.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,18 @@ public function selectRenderer(ViewEvent $e)
return;
}

if ($match->getFormat() == 'json') {
if ($match->getTypeString() == 'application/json') {
// application/json Accept header found
return $this->renderer;
}

// application/javascript Accept header found
if (false != ($callback = $request->getQuery()->get('callback'))) {
$this->renderer->setJsonpCallback($callback);
if ($match->getTypeString() == 'application/javascript') {
// application/javascript Accept header found
if (false != ($callback = $request->getQuery()->get('callback'))) {
$this->renderer->setJsonpCallback($callback);
}
return $this->renderer;
}

return $this->renderer;
}

/**
Expand Down

0 comments on commit 41714a1

Please sign in to comment.