Example #1
0
 /**
  * Getting requested accept type
  *
  * @return void
  */
 protected function setAcceptType()
 {
     $this->acceptType = 'xml';
     $rawAcceptType = $this->request->getHeader('Accept');
     if (strpos($rawAcceptType, 'json') !== false) {
         $this->acceptType = 'json';
     } elseif (strpos($rawAcceptType, 'html') !== false) {
         $this->acceptType = 'html';
     }
 }
Example #2
0
 /**
  * Getting requested accept type
  *
  * @return void
  */
 protected function setAcceptType()
 {
     $this->acceptType = 'html';
     $rawAcceptType = $this->request->getHeader('Accept');
     if ($this->request->getParam('isAjax') === 'true' || strpos($rawAcceptType, 'json') !== false) {
         $this->acceptType = 'json';
     } else {
         if (strpos($rawAcceptType, 'html') !== false) {
             $this->acceptType = 'html';
         } else {
             if (strpos($rawAcceptType, 'xml') !== false) {
                 $this->acceptType = 'xml';
             }
         }
     }
 }
Example #3
0
 /**
  * Process HTTP request object and prepare for token validation
  *
  * @param RequestInterface $httpRequest
  * @return array
  */
 public function prepareRequest($httpRequest)
 {
     $oauthParams = $this->_processRequest($httpRequest->getHeader('Authorization'), $httpRequest->getHeader(\Zend_Http_Client::CONTENT_TYPE), $httpRequest->getContent(), $this->getRequestUrl($httpRequest));
     return $oauthParams;
 }