Skip to content

Commit 1cbd739

Browse files
committed
minor imrpovements
1 parent 75d217f commit 1cbd739

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

logging.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var sensitiveKeys = []string{
2727
"creditcard", // Credit card number
2828
"cvv", // Card verification value
2929
"cvc", // Card verification code
30-
"eamil", // Email address
30+
"email", // Email address
3131
"phone", // Phone number
3232
"address", // Physical address
3333
"account", // Bank account number
@@ -208,6 +208,8 @@ func (m *Middleware) redactQueryParams(queryParams string) string {
208208
}
209209

210210
func (m *Middleware) isSensitiveQueryParamKey(key string) bool {
211+
sensitiveKeysMutex.RLock()
212+
defer sensitiveKeysMutex.RUnlock()
211213
for _, sensitiveKey := range sensitiveKeys { // Use package level sensitiveKeys variable
212214
if strings.Contains(key, sensitiveKey) {
213215
return true

types.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ func (t *CIDRTrie) containsIPv6(ip net.IP) bool {
298298
return false
299299
}
300300

301+
// Add this check to ensure ip is not empty
302+
if len(ip) == 0 {
303+
return false
304+
}
305+
301306
node := t.ipv6Root
302307
for i := 0; i < len(ip)*8; i++ {
303308
bit := (ip[i/8] >> (7 - uint(i%8))) & 1

0 commit comments

Comments
 (0)