diff --git a/src/Strategy/JsonStrategy.php b/src/Strategy/JsonStrategy.php index 9d7c8206..dfa2dab0 100644 --- a/src/Strategy/JsonStrategy.php +++ b/src/Strategy/JsonStrategy.php @@ -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; } /**