Skip to content

Commit 96a1d6f

Browse files
committed
[scrubber] Grant "SanitizeHashUrlPaths" precedence over "SanitizeHash"
1 parent 2392848 commit 96a1d6f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

components/scrubber/scrubber.go

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -221,18 +221,19 @@ func (s *scrubberImpl) getSanitisatiser(key string) Sanitisatiser {
221221
return SanitiseRedact
222222
}
223223
}
224-
for _, f := range s.LowerSanitiseHash {
225-
if strings.Contains(lower, f) {
226-
s.KeySanitiserCache.Add(lower, sanitiseHash)
227-
return SanitiseHash
228-
}
229-
}
224+
// Give sanitiseHashURLPathSegments precedence over sanitiseHash
230225
for _, f := range s.LowerSanitiseHashURLPaths {
231226
if strings.Contains(lower, f) {
232227
s.KeySanitiserCache.Add(lower, sanitiseHashURLPathSegments)
233228
return SanitiseHashURLPathSegments
234229
}
235230
}
231+
for _, f := range s.LowerSanitiseHash {
232+
if strings.Contains(lower, f) {
233+
s.KeySanitiserCache.Add(lower, sanitiseHash)
234+
return SanitiseHash
235+
}
236+
}
236237

237238
s.KeySanitiserCache.Add(lower, sanitiseIgnore)
238239
return nil

0 commit comments

Comments
 (0)