Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[0.74.1] Cherry-pick Hermes atob padding fix #287

Open
hirbod opened this issue May 9, 2024 · 0 comments
Open

[0.74.1] Cherry-pick Hermes atob padding fix #287

hirbod opened this issue May 9, 2024 · 0 comments

Comments

@hirbod
Copy link

hirbod commented May 9, 2024

Target Branch(es)

0.74

Link to commit or PR to be picked

facebook/hermes#1379

Description

base64 decoding fails if the provided string does not contain padding. This is breaking our app.
As a workaround I added following function to add padding before trying to decode.

function ensureBase64Padding(base64: string) {
    const paddingNeeded = (4 - base64.length % 4) % 4;
    return base64 + '='.repeat(paddingNeeded);
}

Kindly asking to cherry-pick this fix.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Inbox
Development

No branches or pull requests

1 participant