-
Notifications
You must be signed in to change notification settings - Fork 18
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
chore: add validation to the ECS Task Metadata #96
Conversation
|
||
// Use a regular expression to validate the characters | ||
// Valid characters include letters (uppercase and lowercase), numbers, hyphens, and underscores | ||
Regex validPattern = new Regex(@"^[A-Za-z0-9\-_]+$"); |
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 am on the fence about the use of RegEx and it's performance impact in this context. Any thoughts?
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.
If I understand this should only ever be called once so it should have negligible performance impact. Also since it should use the Compiled
option since it is only being used. Not that you are using it but adding that feedback in case another reviewer suggest it.
Issue #, if available:
DOTNET-7341
Description of changes:
169.254.170.2
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.