cloudworker icon indicating copy to clipboard operation
cloudworker copied to clipboard

atob() failure behaviour different to cloudflare behaviour

Open dan-overton opened this issue 5 years ago • 0 comments

In version 0.1.2

If I run atob('123===') inside a cloudflare worker, I get an InvalidCharacterException with the message atob() called with invalid base64-encoded data. (Only whitespace, '+', '/', alphanumeric ASCII, and up to two terminal '=' signs when the input data length is divisible by 4 are allowed.)

Running this same script in cloudworker does not raise an exception. It seems to drop down to the 'atob' package, which runs Buffer.from('123===', 'base64').toString('binary');

Related PR: https://github.com/dollarshaveclub/cloudworker/pull/90

dan-overton avatar Oct 16 '19 09:10 dan-overton