Skip to content
This repository was archived by the owner on Jul 25, 2024. It is now read-only.

Commit 74b7344

Browse files
committed
Pass Server URL to HTTPRequest for logging in.
1 parent d3aa8a8 commit 74b7344

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

app/src/main/java/com/zulip/android/networking/AsyncLogin.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ public AsyncLogin(LoginActivity loginActivity, String username, String password,
3636
this.setProperty("username", username);
3737
this.setProperty("password", password);
3838
this.realmName = realmName;
39+
this.request.setServerURL(serverURL);
3940
this.serverURL = serverURL;
4041
}
4142

app/src/main/java/com/zulip/android/networking/HTTPRequest.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,10 +36,15 @@ public class HTTPRequest {
3636
HttpRequestBase request;
3737
HttpResponse response;
3838
volatile boolean aborting = false;
39-
39+
String serverURL = null;
4040
public HTTPRequest(ZulipApp app) {
4141
nameValuePairs = new ArrayList<NameValuePair>();
4242
this.app = app;
43+
this.serverURL = app.getServerURI();
44+
}
45+
46+
public void setServerURL(String serverURL) {
47+
this.serverURL = serverURL;
4348
}
4449

4550
public void setProperty(String key, String value) {
@@ -82,7 +87,7 @@ public String execute(String method, String path) throws IOException {
8287

8388
String responseString = null;
8489
try {
85-
String url = app.getServerURI() + path;
90+
String url = serverURL + path;
8691
nameValuePairs.add(new BasicNameValuePair("client", "Android"));
8792

8893
if (method.equals("POST")) {

0 commit comments

Comments
 (0)