Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
Issue #4128 - Add missing padding and use URL decoder #4129
Issue #4128 - Add missing padding and use URL decoder #4129
Changes from all commits
8b37a8f
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think the case here with
===
is necessary.This could be simplified using the example from
https://tools.ietf.org/html/rfc7515#appendix-C
Something like:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ya, that is simpler. Will look into that.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@lachlan-roberts , @joakime et a. maybe you can help with this, but it seems the above code is licensed under BSD. See https://trustee.ietf.org/documents/IETF-TLP-5_001.html. So, is it OK to bring this in? Does something need to be done, like an attribution or something?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@travisspencer how about we write this in a different way with the same resulting logic.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, good one @lachlan-roberts . That special case for a remainder of 1 took me a sec, but it's because a base64-endoded string will always be an even number. I see.
I think that an if statement like I have below is good to avoid the unnecessary array copy and I'd like to assign
unpaddedBase64.length
to a variable for readability. Will make those changes and update this PR.