[http] Accept all 200 status codes

This commit is contained in:
Johannes Frohnmeyer 2022-10-22 22:26:47 +02:00
parent 96499ca1e3
commit dd9a465c69
Signed by: Johannes
GPG Key ID: E76429612C2929F4

View File

@ -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<String> location = res.headers().firstValue("location");
// Redirect
if (location.isPresent() && (res.statusCode() == 302 || res.statusCode() == 307) && method == Method.GET) {