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

add basic test functionality for andorid library

This commit is contained in:
Christian Schabesberger
2020-09-15 13:51:56 +02:00
committed by Abel García de Prada
parent cc91ad9dde
commit 257cbcff03
2 changed files with 45 additions and 3 deletions
@@ -68,7 +68,7 @@ class GetRemoteStatusOperation : RemoteOperation<OwnCloudVersion>() {
return latestResult
}
private fun updateLocationWithRelativePath(oldLocation: String, redirectedLocation: String): String {
fun updateLocationWithRedirectPath(oldLocation: String, redirectedLocation: String): String {
if(!redirectedLocation.startsWith("/"))
return redirectedLocation
val oldLocation = URL(oldLocation)
@@ -97,7 +97,7 @@ class GetRemoteStatusOperation : RemoteOperation<OwnCloudVersion>() {
return successfulConnection
}
var redirectedLocation = updateLocationWithRelativePath(baseUrlStr, latestResult.redirectedLocation)
var redirectedLocation = updateLocationWithRedirectPath(baseUrlStr, latestResult.redirectedLocation)
while (!redirectedLocation.isNullOrEmpty() && !latestResult.isSuccess) {
isRedirectToNonSecureConnection =
isRedirectToNonSecureConnection ||
@@ -112,7 +112,7 @@ class GetRemoteStatusOperation : RemoteOperation<OwnCloudVersion>() {
status = client.executeHttpMethod(getMethod)
latestResult = RemoteOperationResult(getMethod)
redirectedLocation = updateLocationWithRelativePath(redirectedLocation, latestResult.redirectedLocation)
redirectedLocation = updateLocationWithRedirectPath(redirectedLocation, latestResult.redirectedLocation)
}
if (isSuccess(status)) {