From 726569f0b9d18c311b307f6a108f6749f96423c5 Mon Sep 17 00:00:00 2001 From: Sean Leonard Date: Wed, 5 Mar 2014 11:48:26 -0800 Subject: Rewrite "Server is down" message to "Server is unreachable" --- src/se/leap/bitmaskclient/ProviderAPI.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/se/leap/bitmaskclient/ProviderAPI.java') diff --git a/src/se/leap/bitmaskclient/ProviderAPI.java b/src/se/leap/bitmaskclient/ProviderAPI.java index 5344e471..62d86455 100644 --- a/src/se/leap/bitmaskclient/ProviderAPI.java +++ b/src/se/leap/bitmaskclient/ProviderAPI.java @@ -606,7 +606,7 @@ public class ProviderAPI extends IntentService { } catch (MalformedURLException e) { json_file_content = formatErrorMessage(R.string.malformed_url); } catch(SocketTimeoutException e) { - json_file_content = formatErrorMessage(R.string.server_is_down_message); + json_file_content = formatErrorMessage(R.string.server_unreachable_message); } catch (IOException e) { if(provider_url != null) { json_file_content = downloadWithProviderCA(string_url, danger_on); @@ -644,7 +644,7 @@ public class ProviderAPI extends IntentService { // TODO Auto-generated catch block e.printStackTrace(); } catch (UnknownHostException e) { - json_file_content = formatErrorMessage(R.string.server_is_down_message); + json_file_content = formatErrorMessage(R.string.server_unreachable_message); } catch (IOException e) { // The downloaded certificate doesn't validate our https connection. if(danger_on) { @@ -727,7 +727,7 @@ public class ProviderAPI extends IntentService { System.out.println("String ignoring certificate = " + string); } catch (FileNotFoundException e) { e.printStackTrace(); - string = formatErrorMessage(R.string.server_is_down_message); + string = formatErrorMessage(R.string.server_unreachable_message); } catch (IOException e) { // The downloaded certificate doesn't validate our https connection. e.printStackTrace(); -- cgit v1.2.3 From 2601c824c0a8429326f3fb64533c6ecc56438a7c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Parm=C3=A9nides=20GV?= Date: Thu, 13 Mar 2014 21:09:42 +0100 Subject: Token correctly sent in the http request. --- src/se/leap/bitmaskclient/ProviderAPI.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/se/leap/bitmaskclient/ProviderAPI.java') diff --git a/src/se/leap/bitmaskclient/ProviderAPI.java b/src/se/leap/bitmaskclient/ProviderAPI.java index 62d86455..7aafa2e3 100644 --- a/src/se/leap/bitmaskclient/ProviderAPI.java +++ b/src/se/leap/bitmaskclient/ProviderAPI.java @@ -601,7 +601,7 @@ public class ProviderAPI extends IntentService { URLConnection url_connection = provider_url.openConnection(); url_connection.setConnectTimeout(seconds_of_timeout*1000); if(!LeapSRPSession.getToken().isEmpty()) - url_connection.addRequestProperty(LeapSRPSession.TOKEN, LeapSRPSession.getToken()); + url_connection.addRequestProperty(LeapSRPSession.AUTHORIZATION_HEADER, "Token token = " + LeapSRPSession.getToken()); json_file_content = new Scanner(url_connection.getInputStream()).useDelimiter("\\A").next(); } catch (MalformedURLException e) { json_file_content = formatErrorMessage(R.string.malformed_url); @@ -638,7 +638,7 @@ public class ProviderAPI extends IntentService { (HttpsURLConnection)url.openConnection(); urlConnection.setSSLSocketFactory(getProviderSSLSocketFactory()); if(!LeapSRPSession.getToken().isEmpty()) - urlConnection.addRequestProperty(LeapSRPSession.TOKEN, LeapSRPSession.getToken()); + urlConnection.addRequestProperty(LeapSRPSession.AUTHORIZATION_HEADER, "Token token=" + LeapSRPSession.getToken()); json_file_content = new Scanner(urlConnection.getInputStream()).useDelimiter("\\A").next(); } catch (CertificateException e) { // TODO Auto-generated catch block -- cgit v1.2.3