From 331562c5ae6a851311745d53a0efffb3eec41533 Mon Sep 17 00:00:00 2001 From: kashif khan Date: Thu, 31 Oct 2024 11:06:34 +0500 Subject: [PATCH] fixed gitlab extradata overwriting --- pkg/detectors/gitlab/v1/gitlab.go | 4 +++- pkg/detectors/gitlab/v2/gitlab_v2.go | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/pkg/detectors/gitlab/v1/gitlab.go b/pkg/detectors/gitlab/v1/gitlab.go index 5e9c0ea94b54..ce0c070f5897 100644 --- a/pkg/detectors/gitlab/v1/gitlab.go +++ b/pkg/detectors/gitlab/v1/gitlab.go @@ -72,7 +72,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result if verify { isVerified, extraData, verificationErr := s.verifyGitlab(ctx, resMatch) s1.Verified = isVerified - s1.ExtraData = extraData + for key, value := range extraData { + s1.ExtraData[key] = value + } s1.SetVerificationError(verificationErr, resMatch) s1.AnalysisInfo = map[string]string{ diff --git a/pkg/detectors/gitlab/v2/gitlab_v2.go b/pkg/detectors/gitlab/v2/gitlab_v2.go index 98233fe4ac0b..18e55084da5b 100644 --- a/pkg/detectors/gitlab/v2/gitlab_v2.go +++ b/pkg/detectors/gitlab/v2/gitlab_v2.go @@ -61,7 +61,9 @@ func (s Scanner) FromData(ctx context.Context, verify bool, data []byte) (result if verify { isVerified, extraData, verificationErr := s.verifyGitlab(ctx, resMatch) s1.Verified = isVerified - s1.ExtraData = extraData + for key, value := range extraData { + s1.ExtraData[key] = value + } s1.SetVerificationError(verificationErr, resMatch) s1.AnalysisInfo = map[string]string{