fix(webconnectivity): ignore any status code <= 0 (#579)
This diff changes the algorithm used by webconnectivity's httpanalysis.go to ignore any status code <= 0 rather than just ignoring the == 0 case. Make sure we add test cases for when the control's status code is negative rather than being zero. While there, simplify code where boolean checks could be more compact according to staticcheck. Closes https://github.com/ooni/probe/issues/1825
This commit is contained in:
parent
5b8f4546f3
commit
3b27780836
3 changed files with 82 additions and 8 deletions
|
|
@ -82,7 +82,7 @@ type Summary struct {
|
|||
//
|
||||
// Because of that, we must preserve the original behaviour.
|
||||
func DetermineBlocking(s Summary) interface{} {
|
||||
if s.Accessible != nil && *s.Accessible == true {
|
||||
if s.Accessible != nil && *s.Accessible {
|
||||
return false
|
||||
}
|
||||
return s.BlockingReason
|
||||
|
|
|
|||
Loading…
Reference in a new issue