mirror of
https://github.com/owncloud/android-library.git
synced 2025-06-08 08:26:10 +00:00
Fixed bug. It is not possible to connect to a http server
This commit is contained in:
parent
fe6f99ea6a
commit
585054092d
@ -116,13 +116,12 @@ public class GetRemoteStatusOperation extends RemoteOperation {
|
|||||||
if (isRedirectToNonSecureConnection) {
|
if (isRedirectToNonSecureConnection) {
|
||||||
mLatestResult = new RemoteOperationResult(
|
mLatestResult = new RemoteOperationResult(
|
||||||
RemoteOperationResult.ResultCode.OK_REDIRECT_TO_NON_SECURE_CONNECTION);
|
RemoteOperationResult.ResultCode.OK_REDIRECT_TO_NON_SECURE_CONNECTION);
|
||||||
} else {
|
|
||||||
retval = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ArrayList<Object> data = new ArrayList<Object>();
|
ArrayList<Object> data = new ArrayList<Object>();
|
||||||
data.add(ocVersion);
|
data.add(ocVersion);
|
||||||
mLatestResult.setData(data);
|
mLatestResult.setData(data);
|
||||||
|
retval = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -174,7 +173,7 @@ public class GetRemoteStatusOperation extends RemoteOperation {
|
|||||||
} else {
|
} else {
|
||||||
client.setBaseUri(Uri.parse("https://" + baseUriStr));
|
client.setBaseUri(Uri.parse("https://" + baseUriStr));
|
||||||
boolean httpsSuccess = tryConnection(client);
|
boolean httpsSuccess = tryConnection(client);
|
||||||
if (!httpsSuccess && !mLatestResult.isSslRecoverableException() && mLatestResult.isNonSecureRedirection()) {
|
if (!httpsSuccess && !mLatestResult.isSslRecoverableException()) {
|
||||||
Log.d(TAG, "establishing secure connection failed, trying non secure connection");
|
Log.d(TAG, "establishing secure connection failed, trying non secure connection");
|
||||||
client.setBaseUri(Uri.parse("http://" + baseUriStr));
|
client.setBaseUri(Uri.parse("http://" + baseUriStr));
|
||||||
tryConnection(client);
|
tryConnection(client);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user