File tree Expand file tree Collapse file tree 2 files changed +11
-0
lines changed
owncloudComLibrary/src/main/java/com/owncloud/android/lib/common Expand file tree Collapse file tree 2 files changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -55,6 +55,8 @@ public class OwnCloudClient extends HttpClient {
5555 private static final String WEBDAV_UPLOADS_PATH_4_0 = "/remote.php/dav/uploads/" ;
5656 private static final String KONNECT_V1_TOKEN_PATH = "/konnect/v1/token" ;
5757 public static final String KWDAV_PATH = "/kwdav" ;
58+ private static final String WELL_KNOWN_PATH = "/.well-known" ;
59+ private static final String OAUTH_TOKEN_PATH = "/oauth/token" ;
5860 private static final int MAX_RETRY_COUNT = 2 ;
5961
6062 private static int sIntanceCounter = 0 ;
@@ -140,6 +142,14 @@ private int saveExecuteHttpMethod(HttpBaseMethod method) throws Exception {
140142 method .setRequestHeader (AUTHORIZATION_HEADER , mCredentials .getHeaderAuth ());
141143 }
142144
145+ HttpUrl originalUrl = method .getHttpUrl ();
146+ String encodedPath = originalUrl .encodedPath ();
147+ if (mIsKiteworksServer && !encodedPath .startsWith (WELL_KNOWN_PATH ) && !encodedPath .equals (OAUTH_TOKEN_PATH )) {
148+ HttpUrl newUrl = originalUrl .newBuilder ().encodedPath (KWDAV_PATH + encodedPath ).build ();
149+ method .setUrl (newUrl );
150+ }
151+
152+
143153 status = method .execute (this );
144154
145155 if (shouldConnectionValidatorBeCalled (method , status )) {
Original file line number Diff line number Diff line change @@ -84,6 +84,7 @@ abstract class HttpBaseMethod constructor(url: URL) {
8484 }
8585
8686 open fun setUrl (url : HttpUrl ) {
87+ httpUrl = url
8788 request = request.newBuilder()
8889 .url(url)
8990 .build()
You can’t perform that action at this time.
0 commit comments