fix:Solve the problem that the response stream is blocked when getting the latest version of arthas (#2290)

pull/2293/head
kxkxkxkxkx 2 years ago committed by GitHub
parent 9f3a28e400
commit 9ca6782acd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -34,6 +34,8 @@ public class ArthasBanner {
private static final int CONNECTION_TIMEOUT = 1000;
private static final int READ_TIMEOUT = 1000;
private static String LOGO = "Welcome to Arthas";
private static String VERSION = "unknown";
private static String THANKS = "";
@ -147,6 +149,7 @@ public class ArthasBanner {
URLConnection connection = new URL(url).openConnection();
if (connection instanceof HttpURLConnection) {
connection.setConnectTimeout(CONNECTION_TIMEOUT);
connection.setReadTimeout(READ_TIMEOUT);
// normally, 3xx is redirect
int status = ((HttpURLConnection) connection).getResponseCode();
if (status != HttpURLConnection.HTTP_OK) {

Loading…
Cancel
Save