浏览代码

Fixed detection of authentication method in server with permanent redirection

David A. Velasco 11 年之前
父节点
当前提交
fb9f7797f4
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java

+ 3 - 1
src/com/owncloud/android/operations/DetectAuthenticationMethodOperation.java

@@ -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);
-        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);
+            redirectedLocation = result.getRedirectedLocation();
         } 
 
         // analyze response