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

Change replace method in generateSignature #13

Merged
merged 1 commit into from
Oct 12, 2020
Merged

Conversation

BigFax
Copy link
Contributor

@BigFax BigFax commented Oct 12, 2020

replace method doesn't make a replacement when the parameter is a string. It converts it to a Regex without the g flag.
The consequence is that it will just replace the first occurrence found in the string. If signatures have mutliple =, + or \ after convertion, just the first occurrence will be replaced and the signatures comparaison will fail.

To make a real string replacement, we need to do string.split('=').join(''); or to pass directly a Regex with g flag.

This PR will fix #9

@lmammino lmammino merged commit 9af3291 into lmammino:master Oct 12, 2020
@lmammino
Copy link
Owner

Thank you! Great catch!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

It doesn't work if the dash is included in the alphabet
2 participants