1
0
mirror of https://github.com/owncloud/android-library.git synced 2026-08-20 12:52:53 +00:00

Fix bug: User agent: jakarta is shown when doing GET request

This commit is contained in:
masensio
2015-03-23 14:24:03 +01:00
parent 43f6fe93e6
commit 94ac3a93d3
2 changed files with 21 additions and 8 deletions
@@ -28,6 +28,8 @@ import java.util.ArrayList;
import org.apache.commons.httpclient.HttpStatus;
import org.apache.commons.httpclient.methods.GetMethod;
import org.apache.commons.httpclient.params.HttpMethodParams;
import org.apache.commons.httpclient.params.HttpParams;
import org.json.JSONException;
import org.json.JSONObject;
@@ -76,7 +78,11 @@ public class GetRemoteStatusOperation extends RemoteOperation {
try {
get = new GetMethod(baseUrlSt + AccountUtils.STATUS_PATH);
get.addRequestHeader(USER_AGENT_HEADER, getUserAgent());
HttpParams params = get.getParams().getDefaultParams();
params.setParameter(HttpMethodParams.USER_AGENT, getUserAgent());
get.getParams().setDefaults(params);
client.setFollowRedirects(false);
boolean isRedirectToNonSecureConnection = false;
int status = client.executeMethod(get, TRY_CONNECTION_TIMEOUT, TRY_CONNECTION_TIMEOUT);