From ab2490d11eca1461da37e31f1981ef473ce5a131 Mon Sep 17 00:00:00 2001 From: Federico Torres <federico.torres@grafana.com> Date: Mon, 23 Sep 2024 18:30:52 -0300 Subject: [PATCH] Remove duplicated label name validation Signed-off-by: Federico Torres <federico.torres@grafana.com> --- handler/push.go | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/handler/push.go b/handler/push.go index e832dc91..993b7478 100644 --- a/handler/push.go +++ b/handler/push.go @@ -183,8 +183,7 @@ func splitLabels(labels string) (map[string]string, error) { name, value := components[i], components[i+1] trimmedName := strings.TrimSuffix(name, Base64Suffix) unescapedName := model.UnescapeName(trimmedName, EscapingScheme) - if !model.LabelNameRE.MatchString(trimmedName) || - !model.LabelName(unescapedName).IsValid() || + if !model.LabelName(unescapedName).IsValid() || strings.HasPrefix(trimmedName, model.ReservedLabelPrefix) { return nil, fmt.Errorf("improper label name %q", trimmedName) }