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

Unverified Commit 6fa59894 authored by Tobias Kaminsky's avatar Tobias Kaminsky Committed by GitHub
Browse files

Merge pull request #99 from nextcloud/usernameWithWhitespace

Username with whitespace
parents 00564413 93c8bab9
Loading
Loading
Loading
Loading
+4 −11
Original line number Diff line number Diff line
@@ -68,21 +68,14 @@ public class ToggleFavoriteOperation extends RemoteOperation {
        }

        String webDavUrl = client.getNewWebdavUri(false).toString();
        int pos = filePath.lastIndexOf('/') + 1;
        filePath = filePath.substring(0, pos) + Uri.encode(filePath.substring(pos));

        String fullFilePath = webDavUrl + "/files/" + userID + filePath;
        String encodedPath = Uri.encode(userID + filePath).replace("%2F", "/");
        String fullFilePath = webDavUrl + "/files/" + encodedPath;

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

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

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