summaryrefslogtreecommitdiff
path: root/src/se
diff options
context:
space:
mode:
Diffstat (limited to 'src/se')
-rw-r--r--src/se/leap/bitmaskclient/LeapSRPSession.java3
-rw-r--r--src/se/leap/bitmaskclient/ProviderAPI.java4
2 files changed, 4 insertions, 3 deletions
diff --git a/src/se/leap/bitmaskclient/LeapSRPSession.java b/src/se/leap/bitmaskclient/LeapSRPSession.java
index 0849f777..a317d95e 100644
--- a/src/se/leap/bitmaskclient/LeapSRPSession.java
+++ b/src/se/leap/bitmaskclient/LeapSRPSession.java
@@ -41,7 +41,8 @@ public class LeapSRPSession {
final public static String M1 = "M1";
final public static String M2 = "M2";
final public static String TOKEN = "token";
-
+ final public static String AUTHORIZATION_HEADER= "Authorization";
+
private SRPParameters params;
private String username;
private String password;
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