fix: nil pointer in urltest (#603)
This commit is contained in:
parent
4d7350923c
commit
1f592c43de
2 changed files with 2 additions and 2 deletions
|
@ -287,7 +287,7 @@ func (p *Proxy) URLTest(ctx context.Context, url string, expectedStatus utils.In
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if !expectedStatus.Check(uint16(resp.StatusCode)) {
|
if expectedStatus != nil && !expectedStatus.Check(uint16(resp.StatusCode)) {
|
||||||
// maybe another value should be returned for differentiation
|
// maybe another value should be returned for differentiation
|
||||||
err = errors.New("response status is inconsistent with the expected status")
|
err = errors.New("response status is inconsistent with the expected status")
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,7 +63,7 @@ func NewIntRangesFromList[T constraints.Integer](list []string) (IntRanges[T], e
|
||||||
}
|
}
|
||||||
|
|
||||||
func (ranges IntRanges[T]) Check(status T) bool {
|
func (ranges IntRanges[T]) Check(status T) bool {
|
||||||
if ranges == nil || len(ranges) == 0 {
|
if len(ranges) == 0 {
|
||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue