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

Replace all when handling + in emails #258

Merged
merged 2 commits into from
Jan 13, 2025
Merged

Replace all when handling + in emails #258

merged 2 commits into from
Jan 13, 2025

Conversation

tomrf1
Copy link
Member

@tomrf1 tomrf1 commented Jan 10, 2025

flagged by a code scanning alert
We have special handling for plus signs in email addresses:

  1. when receiving a request via api gateway, it replaces + with a space
  2. when sending to identity api, which needs + to be encoded

In both cases we're doing a string replace call that only replaces the first instance.
This PR changes it to a regex with the global flag, to indicate that all instances should be replaced.

Tested in CODE by creating reminders for email addresses with + in

@tomrf1 tomrf1 merged commit 00e57d8 into main Jan 13, 2025
3 checks passed
@tomrf1 tomrf1 deleted the tf-replaceAll branch January 13, 2025 09:41
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.

2 participants