Skip to content

Commit 4c073aa

Browse files
committed
Fail if bytesequence base64 has padding characters before end of string
httpwg/structured-field-tests#94
1 parent 46503bf commit 4c073aa

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Parser.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -357,7 +357,7 @@ private static function parseByteSequence(ParsingInput $input): Bytes
357357
$startPosition = $input->position();
358358
$input->consumeChar(':');
359359
try {
360-
$bytes = $input->consumeRegex('/^([a-z0-9+\/=]*)/i');
360+
$bytes = $input->consumeRegex('/^([a-z0-9+\/]*=*)(?=:)/i');
361361
$input->consumeChar(':');
362362
return new Bytes(base64_decode($bytes));
363363
} catch (\RuntimeException) {

0 commit comments

Comments
 (0)