Esempio n. 1
0
 public function testGetHttpHost()
 {
     $this->assertEquals('localhost', $this->_model->getHttpHost());
     $_SERVER['HTTP_HOST'] = 'example.com:80';
     $this->assertEquals($_SERVER['HTTP_HOST'], $this->_model->getHttpHost(false));
     $this->assertEquals('example.com', $this->_model->getHttpHost());
 }
Esempio n. 2
0
 /**
  * Validate signature
  *
  * @throws Mage_Oauth_Exception
  */
 protected function _validateSignature()
 {
     $util = new Zend_Oauth_Http_Utility();
     $calculatedSign = $util->sign(array_merge($this->_params, $this->_protocolParams), $this->_protocolParams['oauth_signature_method'], $this->_consumer->getSecret(), $this->_token->getSecret(), $this->_request->getMethod(), $this->_request->getScheme() . '://' . $this->_request->getHttpHost() . $this->_request->getRequestUri());
     if ($calculatedSign != $this->_protocolParams['oauth_signature']) {
         $this->_throwException('', self::ERR_SIGNATURE_INVALID);
     }
 }