Skip to content

Commit

Permalink
Add check to ensure caddyfile config items are not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
pberkel committed Nov 12, 2024
1 parent 1ce5cb3 commit 4032744
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions caddyfile.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ func (rs *RedisStorage) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
configVal = append(configVal, d.Val())
}
}
// There are no valid configurations where configVal slice is empty
if len(configVal) == 0 {
return d.Errf("no value supplied for configuraton key '%s'", configKey)
}

switch configKey {
case "address":
Expand Down

0 comments on commit 4032744

Please sign in to comment.