Fixed detection of authentication method in server with permanent redirection
authorDavid A. Velasco <dvelasco@solidgear.es>
Wed, 26 Mar 2014 07:34:39 +0000 (08:34 +0100)
committerDavid A. Velasco <dvelasco@solidgear.es>
Wed, 26 Mar 2014 07:34:39 +0000 (08:34 +0100)
src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java

index 560109f..c670316 100644 (file)
@@ -95,9 +95,11 @@ public class DetectAuthenticationMethodOperation extends RemoteOperation {
         
         // try to access the root folder, following redirections but not SAML SSO redirections
         result = operation.execute(client);
         
         // try to access the root folder, following redirections but not SAML SSO redirections
         result = operation.execute(client);
-        while (result.isTemporalRedirection() && !result.isIdPRedirection()) {
+        String redirectedLocation = result.getRedirectedLocation(); 
+        while (redirectedLocation != null && redirectedLocation.length() > 0 && !result.isIdPRedirection()) {
             client.setWebdavUri(Uri.parse(result.getRedirectedLocation()));
             result = operation.execute(client);
             client.setWebdavUri(Uri.parse(result.getRedirectedLocation()));
             result = operation.execute(client);
+            redirectedLocation = result.getRedirectedLocation();
         } 
 
         // analyze response  
         } 
 
         // analyze response