Make keys in GetMetadataProperties case-insensitive
This method is used by paths including the one that checks for Azure AD credentials. This makes the keys case-insensitive so the matching is more lenient (e.g. `azureClientId` vs `azureClientID`) Signed-off-by: ItalyPaleAle <43508+ItalyPaleAle@users.noreply.github.com>
This commit is contained in:
parent
7067334215
commit
254affd133
|
@ -125,8 +125,12 @@ func TryGetQueryIndexName(props map[string]string) (string, bool) {
|
|||
|
||||
// GetMetadataProperty returns a property from the metadata map, with support for aliases
|
||||
func GetMetadataProperty(props map[string]string, keys ...string) (val string, ok bool) {
|
||||
lcProps := make(map[string]string, len(props))
|
||||
for k, v := range props {
|
||||
lcProps[strings.ToLower(k)] = v
|
||||
}
|
||||
for _, k := range keys {
|
||||
val, ok = props[k]
|
||||
val, ok = lcProps[strings.ToLower(k)]
|
||||
if ok {
|
||||
return val, true
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue