bugfix
This commit is contained in:
@@ -26,13 +26,8 @@
|
||||
|
||||
class AuthenticationUtil {
|
||||
|
||||
public static function generateAuthenticationHeader($publicKey, $privateKey) {
|
||||
$header = "";
|
||||
if (!($publicKey == null || $privateKey == null)) {
|
||||
$hash = hash_hmac("sha1", $publicKey, $privateKey);
|
||||
$header = "X-Mashape-Authorization: " . base64_encode($publicKey . ":" . $hash);
|
||||
}
|
||||
return $header;
|
||||
public static function generateAuthenticationHeader($mashapeKey) {
|
||||
return "X-Mashape-Authorization: " . $mashapeKey;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -6,8 +6,8 @@ class MashapeAuthentication extends HeaderAuthentication {
|
||||
|
||||
private $headers;
|
||||
|
||||
function __construct($publicKey, $privateKey) {
|
||||
$this->headers = array(AuthenticationUtil::generateAuthenticationHeader($publicKey, $privateKey));
|
||||
function __construct($mashapeKey) {
|
||||
$this->headers = array(AuthenticationUtil::generateAuthenticationHeader($mashapeKey));
|
||||
}
|
||||
|
||||
public function handleHeaders() {
|
||||
|
||||
Reference in New Issue
Block a user