Skip to content

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

Closed

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

Activity

  1. added a commit that references this issue on Apr 8, 2022
  2. added
    buffer
    on Apr 8, 2022
  3. austinkelleher commented on Apr 8, 2022

    @austinkelleher
    Contributor

    I'd be happy to take a look at this one and open a PR!

  4. aduh95 commented on Apr 8, 2022

    @aduh95
    Contributor

    Thanks for volunteering @austinkelleher, PR’s welcome :)

  5. added
    confirmed-bug
    on Apr 8, 2022
  6. added a commit that references this issue on Apr 12, 2022
  7. added a commit that references this issue on Apr 25, 2022
  8. added a commit that references this issue on May 31, 2022
  9. added a commit that references this issue on Sep 16, 2022
  10. added a commit that references this issue on Sep 11, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bufferconfirmed-bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions