Use common identifiers package with less restrictive regex
Regular expressions in the namespaces package are redundant with the pre-existing validator in the "identifiers" package; replace this custom usage with the validator in "identifiers" Signed-off-by: Phil Estes <estesp@linux.vnet.ibm.com>
This commit is contained in:
@@ -225,7 +225,7 @@ func validateTopic(topic string) error {
|
||||
}
|
||||
|
||||
func validateEnvelope(envelope *events.Envelope) error {
|
||||
if err := namespaces.Validate(envelope.Namespace); err != nil {
|
||||
if err := identifiers.Validate(envelope.Namespace); err != nil {
|
||||
return errors.Wrapf(err, "event envelope has invalid namespace")
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user