/** * Method to send the application response to the client. All headers will be sent prior to the main * application output data. * * @return void * * @since 3.2 */ protected function respond() { $runtime = microtime(true) - $this->_startTime; // Set the Server and X-Powered-By Header. $this->setHeader('Server', '', true); $this->setHeader('X-Powered-By', 'JoomlaWebAPI/1.0', true); $this->setHeader('X-Runtime', $runtime, true); $this->setHeader('Access-Control-Allow-Origin', '*', true); // Copy document encoding and charset into application. $this->mimeType = $this->getDocument()->getMimeEncoding(); $this->charSet = $this->getDocument()->getCharset(); parent::respond(); }
/** * Method to send the application response to the client. All headers will be sent prior to the main * application output data. * * @return void * * @since 3.2 */ protected function respond() { $runtime = microtime(true) - $this->_startTime; // Set the Server and X-Powered-By Header. $this->setHeader('Server', '', true); $this->setHeader('X-Powered-By', 'JoomlaWebAPI/1.0', true); $this->setHeader('X-Runtime', $runtime, true); $this->setHeader('Access-Control-Allow-Origin', '*', true); // Copy document encoding and charset into application. $this->mimeType = $this->getDocument()->getMimeEncoding(); $this->charSet = $this->getDocument()->getCharset(); $body = $this->getBody(); // Check if the request is CORS ( Cross-origin resource sharing ) and change the body if true $body = (string) $this->prepareBody($body); $this->setBody($body); parent::respond(); }