From 4524cb57149b1ca7afcdbf404815fa0acda37af1 Mon Sep 17 00:00:00 2001 From: Marian Steinbach Date: Tue, 20 Nov 2018 20:14:52 +0100 Subject: [PATCH] Consider site reachable only with status code < 400 (#89) --- rating/reachable.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rating/reachable.py b/rating/reachable.py index 381cdb0..15da960 100644 --- a/rating/reachable.py +++ b/rating/reachable.py @@ -22,6 +22,11 @@ class Rater(AbstractRater): for url in self.check_results['url_reachability']: if self.check_results['url_reachability'][url]['exception'] is not None: continue + + # only count status 2** or 3** as reachable + if self.check_results['url_reachability'][url]['status'] >= 400: + continue + count += 1 if count > 0: