cdn/controllers/Serve.php
protected function serveBadSrc(array $params)
    {
        $error = $params['error'];

        $oInput = Factory::service('Input');
        header('Cache-Control: no-cache, must-revalidate', true);
        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT', true);
        header('Content-Type: application/json', true);
        header($oInput->server('SERVER_PROTOCOL') . ' 400 Bad Request', true, 400);

        // --------------------------------------------------------------------------

        $out = [
            'status'  => 400,
            'message' => 'Invalid Request',
        ];

        if (!empty($error)) {
            $out['error'] = $error;
        }

        echo json_encode($out);

        // --------------------------------------------------------------------------

        /**
         * Kill script, th, th, that's all folks. Stop the output class from hijacking
         * our headers and setting an incorrect Content-Type
         */

        exit(0);
    }
protected function serveBadSrc(array $params)
    {
        $error = $params['error'];

        $oInput = Factory::service('Input');
        header('Cache-Control: no-cache, must-revalidate', true);
        header('Expires: Mon, 26 Jul 1997 05:00:00 GMT', true);
        header('Content-Type: application/json', true);
        header($oInput->server('SERVER_PROTOCOL') . ' 400 Bad Request', true, 400);

        // --------------------------------------------------------------------------

        $out = [
            'status'  => 400,
            'message' => 'Invalid Request',
        ];

        if (!empty($error)) {
            $out['error'] = $error;
        }

        echo json_encode($out);

        // --------------------------------------------------------------------------

        /**
         * Kill script, th, th, that's all folks. Stop the output class from hijacking
         * our headers and setting an incorrect Content-Type
         */

        exit(0);
    }
protected function serveBadSrc ( array $ params ) { $ error = $ params [ 'error' ] ; $ oInput = Factory :: service ( 'Input' ) ; header ( 'Cache-Control: no-cache, must-revalidate' , true ) ; header ( 'Expires: Mon, 26 Jul 1997 05:00:00 GMT' , true ) ; header ( 'Content-Type: application/json' , true ) ; header ( $ oInput -> server ( 'SERVER_PROTOCOL' ) . ' 400 Bad Request' , true , 400 ) ; // -------------------------------------------------------------------------- $ out = [ 'status' => 400 , 'message' => 'Invalid Request' , ] ; if ( ! empty ( $ error ) ) { $ out [ 'error' ] = $ error ; } echo json_encode ( $ out ) ; // -------------------------------------------------------------------------- /**
         * Kill script, th, th, that's all folks. Stop the output class from hijacking
         * our headers and setting an incorrect Content-Type
         */ exit ( 0 ) ; }
Serves a response for bad requests

@param array $params

@internal param string $error The error which occurred
Serves a response for bad requests