-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
isBase64 padding support #2501
Comments
I think this is expected behaviour. While RFC 4648 permits Base64 without padding, it states that padding should be used unless all parties involved agree to omit it.
const result = validator.isBase64(base64, {urlSafe: true}); // true |
The base64url is different encoding to the normal base64, other encoding dictionary is used.w
Makes sense for the current behaviour to be the default one, considering it is part of the spec. But it seems reasonable to me there to be an option to support such cases where the parties agree to such behaviour. |
makes sense @antonio-ivanovski |
Describe the bug
Sometimes when base64 strings has the padding removed for either legacy or bandwidth purposes. In those cases, the padding check needs to be ignored or manually the padding to be added.
Either this should be the default behavior or config option should be added.
Examples
The text was updated successfully, but these errors were encountered: