bugfix/allow-plus-characters-in-email #197
Open
+1
−1
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.
In the RFC, these characters are allowed in the local part. I was using this for testing and found that
+
didn't work, however that's a pretty commonly used character in email addresses. When I looked into the spec I found that there were many characters that are valid and so I added them to the regex alongside+
.PR Details
This updates the email regex pattern to be more accepting of valid email addresses. Specifically allowing ones with
+
, but other RFC defined characters as well.Motivation and Context
The regex was incorrect according to the RFC, to allow more valid tests to execute against this server the email regex had to be adjusted.
How Has This Been Tested
It was tested by executing a test against the server with the kind of email in question. You can also note that the only thing that's changed is the regex and you can see that it works with any Go regex tester tool and produces the desired results.
Types of changes
Checklist
golangci-lint run
from the root directory to see all new and existing tests passgo tool cover
to avoid test coverage degradation