projects
/
pub
/
Android
/
ownCloud.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
OC-208: suffix remote.php/webdav. OC-34
[pub/Android/ownCloud.git]
/
src
/
com
/
owncloud
/
android
/
authentication
/
AuthenticatorActivity.java
diff --git
a/src/com/owncloud/android/authentication/AuthenticatorActivity.java
b/src/com/owncloud/android/authentication/AuthenticatorActivity.java
index
13ffd2a
..
9ea2a62
100644
(file)
--- a/
src/com/owncloud/android/authentication/AuthenticatorActivity.java
+++ b/
src/com/owncloud/android/authentication/AuthenticatorActivity.java
@@
-110,7
+110,8
@@
implements OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
public static final byte ACTION_CREATE = 0;
\r
public static final byte ACTION_UPDATE_TOKEN = 1;
\r
\r
public static final byte ACTION_CREATE = 0;
\r
public static final byte ACTION_UPDATE_TOKEN = 1;
\r
\r
-
\r
+ public static final String WEBDAV_PATH= "/remote.php/webdav";
\r
+
\r
private String mHostBaseUrl;
\r
private OwnCloudVersion mDiscoveredVersion;
\r
\r
private String mHostBaseUrl;
\r
private OwnCloudVersion mDiscoveredVersion;
\r
\r
@@
-426,7
+427,7
@@
implements OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
\r
\r
private void checkOcServer() {
\r
\r
\r
private void checkOcServer() {
\r
- String uri =
mHostUrlInput.getText().toString().trim(
);
\r
+ String uri =
trimUrlWebdav(mHostUrlInput.getText().toString().trim()
);
\r
mServerIsValid = false;
\r
mServerIsChecked = false;
\r
mOkButton.setEnabled(false);
\r
mServerIsValid = false;
\r
mServerIsChecked = false;
\r
mOkButton.setEnabled(false);
\r
@@
-641,15
+642,29
@@
implements OnRemoteOperationListener, OnSslValidatorListener, OnFocusChangeList
} else {
\r
url = "http://" + url;
\r
}
\r
} else {
\r
url = "http://" + url;
\r
}
\r
-
\r
}
\r
}
\r
+
\r
+ // OC-208: Add suffix remote.php/webdav to normalize (OC-34)
\r
+ url = trimUrlWebdav(url);
\r
+
\r
if (url.endsWith("/")) {
\r
url = url.substring(0, url.length() - 1);
\r
}
\r
if (url.endsWith("/")) {
\r
url = url.substring(0, url.length() - 1);
\r
}
\r
+
\r
}
\r
}
\r
+ Log_OC.d(TAG, "URL Normalize " + url);
\r
return (url != null ? url : "");
\r
}
\r
\r
return (url != null ? url : "");
\r
}
\r
\r
+
\r
+ private String trimUrlWebdav(String url){
\r
+ if(url.toLowerCase().endsWith(WEBDAV_PATH)){
\r
+ url = url.substring(0, url.length() - WEBDAV_PATH.length());
\r
+ }
\r
+ return (url != null ? url : "");
\r
+ }
\r
+
\r
+
\r
/**
\r
* Chooses the right icon and text to show to the user for the received operation result.
\r
*
\r
/**
\r
* Chooses the right icon and text to show to the user for the received operation result.
\r
*
\r