Skip to content

Commit

Permalink
Allow 0 as weights
Browse files Browse the repository at this point in the history
Change positive to non-negative
  • Loading branch information
peanutduck committed Jun 12, 2024
1 parent d85cc2e commit af484f9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/caddyhttp/reverseproxy/selectionpolicies.go
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,8 @@ func (r *WeightedRoundRobinSelection) UnmarshalCaddyfile(d *caddyfile.Dispenser)
if err != nil {
return d.Errf("invalid weight value '%s': %v", weight, err)
}
if weightInt < 1 {
return d.Errf("invalid weight value '%s': weight should be non-zero and positive", weight)
if weightInt < 0 {
return d.Errf("invalid weight value '%s': weight should be non-negative", weight)
}
r.Weights = append(r.Weights, weightInt)
}
Expand Down

0 comments on commit af484f9

Please sign in to comment.