diff --git a/src/fr/devinsy/statoolinfos/uptime/UptimeSurveyor.java b/src/fr/devinsy/statoolinfos/uptime/UptimeSurveyor.java index a10806a..96f8c9f 100644 --- a/src/fr/devinsy/statoolinfos/uptime/UptimeSurveyor.java +++ b/src/fr/devinsy/statoolinfos/uptime/UptimeSurveyor.java @@ -79,6 +79,7 @@ public class UptimeSurveyor int boundMax = 7; boolean ended = false; URL currentURL = url; + String currentUserAgent = "StatoolInfos Uptime Bot"; result = 0; int currentBound = 0; while (!ended) @@ -88,7 +89,7 @@ public class UptimeSurveyor HttpURLConnection connection = (HttpURLConnection) currentURL.openConnection(); connection.setConnectTimeout(5 * 1000); connection.setReadTimeout(5 * 1000); - connection.setRequestProperty("User-Agent", "StatoolInfos Uptime Bot"); + connection.setRequestProperty("User-Agent", currentUserAgent); result = connection.getResponseCode(); String location = connection.getHeaderField("Location"); connection.disconnect(); @@ -100,6 +101,13 @@ public class UptimeSurveyor currentBound += 1; } + else if (result == 403) + { + System.out.println(Thread.currentThread().getId() + " 403 FORBIDDEN DETECTED " + currentURL.toString() + " -> " + location); + currentUserAgent = "Mozilla from StatoolInfos Uptime B**"; + + currentBound += 1; + } else { ended = true;