Skip to content

Commit 8342de7

Browse files
authored
Remove UTF-8 encoding check in JWEBuilder (#554)
The UTF-8 encoding validation for the payload in the JWEBuilder has been removed. This modification was necessary because the check was unnecessarily restrictive and caused issues in certain use-cases. Now, any string can be used as the payload without throwing an InvalidArgumentException.
1 parent 570052b commit 8342de7

File tree

1 file changed

+0
-3
lines changed

1 file changed

+0
-3
lines changed

src/Library/Encryption/JWEBuilder.php

-3
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,6 @@ public function getCompressionMethodManager(): null|CompressionMethodManager
132132
*/
133133
public function withPayload(string $payload): self
134134
{
135-
if (mb_detect_encoding($payload, 'UTF-8', true) !== 'UTF-8') {
136-
throw new InvalidArgumentException('The payload must be encoded in UTF-8');
137-
}
138135
$clone = clone $this;
139136
$clone->payload = $payload;
140137

0 commit comments

Comments
 (0)