Skip to content

Commit 1d41d50

Browse files
committed
Merge branch 'broken-links' of github.com:barsh404error/TJ-Bot into broken-links
2 parents cc87e38 + 24998cf commit 1d41d50

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

application/src/main/java/org/togetherjava/tjbot/features/utils/LinkDetection.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ public static CompletableFuture<Boolean> isLinkBroken(String url) {
143143
return HTTP_CLIENT.sendAsync(headRequest, HttpResponse.BodyHandlers.discarding())
144144
.thenApply(response -> {
145145
int status = response.statusCode();
146+
// 2xx and 3xx are success, 4xx and 5xx are errors
146147
return status >= 400;
147148
})
148149
.exceptionally(ignored -> true)

0 commit comments

Comments
 (0)