1
0
Fork 0

fix: false positive in url anonymization

This commit is contained in:
Harold Ozouf 2023-09-26 08:28:25 +02:00 committed by GitHub
parent 173154cf59
commit b786f58f80
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 10 additions and 10 deletions

View file

@ -4,7 +4,6 @@ import (
"encoding/json"
"fmt"
"reflect"
"regexp"
"github.com/mitchellh/copystructure"
"github.com/traefik/traefik/v2/pkg/config/dynamic"
@ -67,8 +66,7 @@ func do(baseConfig interface{}, tag string, redactByDefault, indent bool) (strin
}
func doOnJSON(input string) string {
mailExp := regexp.MustCompile(`\w[-.\w]*\w@\w[-.\w]*\w\.\w{2,3}"`)
return xurls.Relaxed().ReplaceAllString(mailExp.ReplaceAllString(input, maskLarge+"\""), maskLarge)
return xurls.Relaxed().ReplaceAllString(input, maskLarge)
}
func doOnStruct(field reflect.Value, tag string, redactByDefault bool) error {