Skip to content

Commit 363c40d

Browse files
committed
:octocat: output the decoded header
1 parent 71a87c3 commit 363c40d

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

src/JWS.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ public function decode(string $jwt):array{
7373
throw new RuntimeException(sprintf('invalid "alg" parameter: "%s"', $decodedHeader['alg'])); // @codeCoverageIgnore
7474
}
7575

76-
return [$header, $payload];
76+
return [$decodedHeader, $payload];
7777
}
7878

7979
}

tests/Algorithms/Signature/SignatureAlgoTestAbstract.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ protected function assertSign(SignatureAlgorithm $signAlgo):void{
3232
$jwt = $jws->encode($expectedPayload);
3333
[$header, $payload] = $jws->decode($jwt);
3434

35-
$this::assertSame($expectedHeader, Util::jsonDecode($header));
35+
$this::assertSame($expectedHeader, $header);
3636
$this::assertSame($expectedPayload, Util::jsonDecode($payload));
3737
}
3838

@@ -75,7 +75,7 @@ public function rfcSignExamples(
7575
// this covers the EC random hashes too
7676
$this::assertTrue($verifyAlgo->verify($header.'.'.$payload, Util::base64decode($signature)));
7777

78-
$this::assertSame([Util::base64decode($expectedHeader), $payloadString], $jws->decode($jwt));
78+
$this::assertSame([Util::jsonDecode(Util::base64decode($expectedHeader)), $payloadString], $jws->decode($jwt));
7979
}
8080

8181
}

0 commit comments

Comments
 (0)