No check needed. Parsing will throw an error if base64 is not valid - #1
Open
levinunnink wants to merge 8 commits into
Open
No check needed. Parsing will throw an error if base64 is not valid#1levinunnink wants to merge 8 commits into
levinunnink wants to merge 8 commits into
Conversation
Member
|
Hey @levinunnink thanks for the PR, your right, thanks for removing the function (i was anyway not happy with this big and complex regex) Could you also remove the |
Author
|
@michaelzoidl Whoops! I totally missed the test coverage. It should be fixed now. |
Member
|
Wow, totally forgot this PR. I've seen you published your own version with the name Alternative i could mention your repository in the README of this one. |
Author
|
@michaelzoidl No worries! I just need to ship this fix into production so I forked it. I'm fine with whatever you want to do. :-) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
We don't actually need to run the regex check on the base64 string.
window.atobor theBuffer.fromwill both throw errors if the string is invalid and theparseJwtTokenwill return false.By removing this, we don't get any invalid results on valid jwt tokens.