[http] Accept all 200 status codes
This commit is contained in:
parent
96499ca1e3
commit
dd9a465c69
|
@ -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) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user