Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Unverified Commit 93c8bab9 authored by tobiasKaminsky's avatar tobiasKaminsky
Browse files

uri encode only user id and path, but omit "/"

parent 00564413
Loading
Loading
Loading
Loading
+4 −11
Original line number Original line Diff line number Diff line
@@ -68,21 +68,14 @@ public class ToggleFavoriteOperation extends RemoteOperation {
        }
        }


        String webDavUrl = client.getNewWebdavUri(false).toString();
        String webDavUrl = client.getNewWebdavUri(false).toString();
        int pos = filePath.lastIndexOf('/') + 1;
        String encodedPath = Uri.encode(userID + filePath).replace("%2F", "/");
        filePath = filePath.substring(0, pos) + Uri.encode(filePath.substring(pos));
        String fullFilePath = webDavUrl + "/files/" + encodedPath;

        String fullFilePath = webDavUrl + "/files/" + userID + filePath;


        try {
        try {
            propPatchMethod = new PropPatchMethod(fullFilePath,
            propPatchMethod = new PropPatchMethod(fullFilePath, newProps, removeProperties);
                    newProps,
                    removeProperties);
            int status = client.executeMethod(propPatchMethod);
            int status = client.executeMethod(propPatchMethod);


            boolean isSuccess = (
            boolean isSuccess = (status == HttpStatus.SC_MULTI_STATUS || status == HttpStatus.SC_OK);
                    status == HttpStatus.SC_MULTI_STATUS ||
                            status == HttpStatus.SC_OK
            );


            if (isSuccess) {
            if (isSuccess) {
                result = new RemoteOperationResult(true, status, propPatchMethod.getResponseHeaders());
                result = new RemoteOperationResult(true, status, propPatchMethod.getResponseHeaders());