From dd9a465c69a8950b34c53e97c87320df65f396c1 Mon Sep 17 00:00:00 2001 From: JFronny Date: Sat, 22 Oct 2022 22:26:47 +0200 Subject: [PATCH] [http] Accept all 200 status codes --- src/main/java/io/gitlab/jfronny/commons/HttpUtils.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/io/gitlab/jfronny/commons/HttpUtils.java b/src/main/java/io/gitlab/jfronny/commons/HttpUtils.java index 7f18ca4..6cc1567 100644 --- a/src/main/java/io/gitlab/jfronny/commons/HttpUtils.java +++ b/src/main/java/io/gitlab/jfronny/commons/HttpUtils.java @@ -139,7 +139,7 @@ public class HttpUtils { } catch (InterruptedException e) { throw new IOException("Could not send request", e); } - if (res.statusCode() == 200) return res.body(); + if (res.statusCode() / 100 == 2) return res.body(); Optional location = res.headers().firstValue("location"); // Redirect if (location.isPresent() && (res.statusCode() == 302 || res.statusCode() == 307) && method == Method.GET) {