Skip to content

atob should throw an error if the input is not correctly encoded #42646

@zloirock

Description

@zloirock

Version

17.9.0

Platform

MacOS 12.2

Subsystem

global / buffer

What steps will reproduce the bug?

No response

How often does it reproduce? Is there a required condition?

No response

What is the expected behavior?

atob('a') // => DOMException
atob('a ') // => DOMException
atob('aaaaa') // => DOMException

What do you see instead?

atob('a') === ''
atob('a ') === ''
atob('aaaaa') === 'i¦\x9A'

Additional information

https://infra.spec.whatwg.org/#forgiving-base64-decode step 3

Related to #42539 / #42530 @aduh95

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferIssues and PRs related to the buffer subsystem.confirmed-bugIssues with confirmed bugs.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions