1
0
Fork 0

Make the keys of the accessLog.fields.names map case-insensitive

This commit is contained in:
Roman Donchenko 2024-09-13 11:04:07 +03:00 committed by GitHub
parent be5c429825
commit 71d4b3b13c
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 46 additions and 7 deletions

View file

@ -462,6 +462,32 @@ func TestLoggerJSON(t *testing.T) {
RequestRefererHeader: assertString(testReferer),
},
},
{
desc: "fields and headers with unconventional letter case",
config: &types.AccessLog{
FilePath: "",
Format: JSONFormat,
Fields: &types.AccessLogFields{
DefaultMode: "drop",
Names: map[string]string{
"rEqUeStHoSt": "keep",
},
Headers: &types.FieldHeaders{
DefaultMode: "drop",
Names: map[string]string{
"ReFeReR": "keep",
},
},
},
},
expected: map[string]func(t *testing.T, value interface{}){
RequestHost: assertString(testHostname),
"level": assertString("info"),
"msg": assertString(""),
"time": assertNotEmpty(),
RequestRefererHeader: assertString(testReferer),
},
},
}
for _, test := range testCases {