@@ -125,7 +125,7 @@ func GetXForwardedForFromValue(value *string) *string {
125
125
126
126
func GetSourceIp (reqHeaders []NV , traceMeta TraceMeta ) * string {
127
127
for _ , header := range reqHeaders {
128
- if strings .ToLower (header .Name ) == "x-forwarded-for" {
128
+ if strings .EqualFold (header .Name , "x-forwarded-for" ) {
129
129
xForwardedValue := GetXForwardedForFromValue (& header .Value )
130
130
return xForwardedValue
131
131
}
@@ -160,8 +160,8 @@ func CheckStringCondition(condOperator *string, condValue *string, reqValue *str
160
160
161
161
func GetKeyValuePairValue (key string , keyValuePairs []NV ) * string {
162
162
for _ , pair := range keyValuePairs {
163
- if strings .ToLower (pair .Name ) == key {
164
- return & pair .Name
163
+ if strings .EqualFold (pair .Name , key ) {
164
+ return & pair .Value
165
165
}
166
166
}
167
167
return nil
@@ -222,7 +222,7 @@ func CheckKeyValuePair(condOperator *string, condKey *string, condValue *string,
222
222
return false
223
223
}
224
224
for _ , pair := range keyValuePairs {
225
- if strings .ToLower (pair .Name ) == strings . ToLower ( * condKey ) && CheckStringCondition (condOperator , condValue , & pair .Value ) {
225
+ if strings .EqualFold (pair .Name , * condKey ) && CheckStringCondition (condOperator , condValue , & pair .Value ) {
226
226
return true
227
227
}
228
228
}
@@ -424,7 +424,7 @@ func HandleSessionIdentifier(authentication *Authentication, headers []NV, key *
424
424
return
425
425
}
426
426
headerKey := * authentication .HeaderKey
427
- headerValuePtr := GetKeyValuePairValue (strings . ToLower ( headerKey ) , headers )
427
+ headerValuePtr := GetKeyValuePairValue (headerKey , headers )
428
428
if headerValuePtr != nil {
429
429
key .WriteRune ('_' )
430
430
key .WriteString (* headerValuePtr )
0 commit comments