You've already forked oauth2-proxy
mirror of
https://github.com/oauth2-proxy/oauth2-proxy.git
synced 2026-05-22 10:15:21 +02:00
Return an error when unknown options are found in the config file
This commit is contained in:
@@ -38,7 +38,9 @@ func Load(configFileName string, flagSet *pflag.FlagSet, into interface{}) error
|
||||
return fmt.Errorf("unable to register flags: %w", err)
|
||||
}
|
||||
|
||||
err = v.Unmarshal(into, decodeFromCfgTag)
|
||||
// UnmarhsalExact will return an error if the config includes options that are
|
||||
// not mapped to felds of the into struct
|
||||
err = v.UnmarshalExact(into, decodeFromCfgTag)
|
||||
if err != nil {
|
||||
return fmt.Errorf("error unmarshalling config: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user