Skip to content

Commit

Permalink
Reversing array merge to avoid overwrites of default headers
Browse files Browse the repository at this point in the history
  • Loading branch information
mcocaro committed Jun 18, 2015
1 parent abc1f5b commit 37feebf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Authentication/JWT.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public static function encode($payload, $key, $alg = 'HS256', $keyId = null, $he
$header['kid'] = $keyId;
}
if ( isset($head) && is_array($head) ) {
$header = array_merge($header, $head);
$header = array_merge($head, $header);
}
$segments = array();
$segments[] = JWT::urlsafeB64Encode(JWT::jsonEncode($header));
Expand Down

0 comments on commit 37feebf

Please sign in to comment.