X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=src%2Fnet%2Fsf%2Fopenrocket%2Fcommunication%2FUpdateInfoRetriever.java;fp=src%2Fnet%2Fsf%2Fopenrocket%2Fcommunication%2FUpdateInfoRetriever.java;h=4fd0782461b417289f21520d3bd2c2662cc6f88d;hb=c72e1c03cc0d15e11368707c38721d506ce356b9;hp=082f2b9f7491e85a62882a6a8209aeb1313b377e;hpb=d23932f311312abb73801262a80ef2f6bc66818d;p=debian%2Fopenrocket diff --git a/src/net/sf/openrocket/communication/UpdateInfoRetriever.java b/src/net/sf/openrocket/communication/UpdateInfoRetriever.java index 082f2b9f..4fd07824 100644 --- a/src/net/sf/openrocket/communication/UpdateInfoRetriever.java +++ b/src/net/sf/openrocket/communication/UpdateInfoRetriever.java @@ -153,7 +153,7 @@ public class UpdateInfoRetriever { System.getProperty("java.version"))); connection.setRequestProperty("X-OpenRocket-Country", Communicator.encode(System.getProperty("user.country") + " " + - Communicator.encode(System.getProperty("user.timezone")))); + System.getProperty("user.timezone"))); InputStream is = null; try { @@ -169,15 +169,19 @@ public class UpdateInfoRetriever { if (connection.getResponseCode() != Communicator.UPDATE_INFO_UPDATE_AVAILABLE) { // Error communicating with server + System.out.println("Unknown response code: " + connection.getResponseCode()); return; } - if (!Communicator.UPDATE_INFO_CONTENT_TYPE.equalsIgnoreCase( - connection.getContentType())) { + String contentType = connection.getContentType(); + if (contentType == null || + contentType.toLowerCase().indexOf(Communicator.UPDATE_INFO_CONTENT_TYPE) < 0) { // Unknown response type + System.out.println("Unknown Content-type received:"+contentType); return; } + System.out.println("Update is available"); // Update is available, parse input is = connection.getInputStream(); @@ -209,12 +213,13 @@ public class UpdateInfoRetriever { if (version == null || version.length() == 0 || version.equalsIgnoreCase(Prefs.getVersion())) { // Invalid response + System.out.println("Invalid version received, ignoring."); return; } info = new UpdateInfo(version, updates); - + System.out.println("Found update: " + info); } finally { try { if (is != null)