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

Commit 65cf641

Browse files
committed
Give Server URL to HTTPRequest for logging in.
1 parent 33a0c2f commit 65cf641

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ public AsyncLogin(LoginActivity loginActivity, String username,
3131
this.setProperty("username", username);
3232
this.setProperty("password", password);
3333
this.serverURL = server;
34+
this.request.setServer(serverURL);
3435
this.realmName = realmName;
3536
}
3637

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

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,16 @@ public class HTTPRequest {
3434
HttpRequestBase request;
3535
HttpResponse response;
3636
volatile boolean aborting = false;
37+
String server=null;
3738

3839
HTTPRequest(ZulipApp app) {
3940
nameValuePairs = new ArrayList<NameValuePair>();
4041
this.app = app;
42+
server = app.getServerURI();
43+
}
44+
45+
public void setServer(String url){
46+
this.server = url;
4147
}
4248

4349
public void setProperty(String key, String value) {
@@ -80,7 +86,7 @@ String execute(String method, String path) throws IOException {
8086

8187
String responseString = null;
8288
try {
83-
String url = app.getServerURI() + path;
89+
String url = server + path;
8490
nameValuePairs.add(new BasicNameValuePair("client", "Android"));
8591

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

0 commit comments

Comments
 (0)