public function call()
    {
        if ('application/json' !== $this->app->request()->headers('Accept')) {

            $this->next->call();

            return; //Only JSON can be turned into JSONP
        }

        $callback = $this->app->request()->get('callback');

        $this->next->call();

        if (empty($callback)) {
            return; //Not a JSONP request
        }

        $this->app->contentType('application/javascript');
        $jsonp = htmlspecialchars($callback) . "(" .$this->app->response()->body() . ")";

        $this->app->response()->body($jsonp);
    }