Skip to content

Commit

Permalink
Update lib/buffer.js
Browse files Browse the repository at this point in the history
Co-authored-by: Antoine du Hamel <duhamelantoine1995@gmail.com>
  • Loading branch information
XadillaX and aduh95 committed Oct 8, 2022
1 parent 156937f commit c8edb80
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/buffer.js
Expand Up @@ -1283,6 +1283,9 @@ function atob(input) {
if (index === kForgivingBase64AllowedChars.length - 1) {
// The last element of `kForgivingBase64AllowedChars` is the `=`
equalCharCount++;
} else if (equalCharCount) {
// Only one more `=` is permitted after the first equal sign.
throw lazyDOMException('Invalid character', 'InvalidCharacterError');
}
} else if (index === -1) {
throw lazyDOMException('Invalid character', 'InvalidCharacterError');
Expand Down

0 comments on commit c8edb80

Please sign in to comment.