1
0
mirror of https://github.com/oauth2-proxy/oauth2-proxy.git synced 2025-06-17 00:17:40 +02:00

options: update options parsing for better handling of incorrect values

* don't add in failed compiled regexes for skip auth regex option
* improve test coverage for skip auth regex option to handle partial
success case
* add tests for incorrect upstream options parsing errors
This commit is contained in:
Dave Nicponski
2017-05-05 15:47:40 -04:00
committed by Tanvir Alam
parent a7c5d9c478
commit e955d2be0e
2 changed files with 23 additions and 2 deletions

View File

@ -180,8 +180,8 @@ func (o *Options) Validate() error {
for _, u := range o.SkipAuthRegex {
CompiledRegex, err := regexp.Compile(u)
if err != nil {
msgs = append(msgs, fmt.Sprintf(
"error compiling regex=%q %s", u, err))
msgs = append(msgs, fmt.Sprintf("error compiling regex=%q %s", u, err))
continue
}
o.CompiledRegex = append(o.CompiledRegex, CompiledRegex)
}