1
0
Fork 0
mirror of https://github.com/syncthing/syncthing-android.git synced 2024-11-23 04:41:16 +00:00

Bugfix: Request parameters are duplicated over and over if request is repeated.

This commit is contained in:
FlashSystems 2015-07-14 19:30:20 +02:00
parent 867e5d1ede
commit cd2d67e93e

View file

@ -55,14 +55,15 @@ public class GetTask extends AsyncTask<String, Void, String> {
String fullUri = params[0] + params[1];
Log.v(TAG, "Calling Rest API at " + fullUri);
if (params.length == 5) {
LinkedList<NameValuePair> urlParams = new LinkedList<>();
urlParams.add(new BasicNameValuePair(params[3], params[4]));
fullUri += "?" + URLEncodedUtils.format(urlParams, HTTP.UTF_8);
}
// Retry at most 10 times before failing
for (int i = 0; i < 10; i++) {
HttpClient httpclient = Https.createHttpsClient(mHttpsCertPath);
if (params.length == 5) {
LinkedList<NameValuePair> urlParams = new LinkedList<>();
urlParams.add(new BasicNameValuePair(params[3], params[4]));
fullUri += "?" + URLEncodedUtils.format(urlParams, HTTP.UTF_8);
}
HttpGet get = new HttpGet(fullUri);
get.addHeader(new BasicHeader(RestApi.HEADER_API_KEY, params[2]));