Fix not found dialog during unlock if it contains a blank using OneDrive

"Vault not found" dialog is displayed during unlocking if it contains a blank character due to encoding twice. MicrosoftGraph now encodes the provided path to `itemWithPath` itself.

Fixes #419
This commit is contained in:
Julian Raufelder 2022-03-04 15:50:06 +01:00
parent d0a3a05afb
commit 8f69701b82
No known key found for this signature in database
GPG Key ID: 17EE71F6634E381D

View File

@ -1,7 +1,6 @@
package org.cryptomator.data.cloud.onedrive
import android.content.Context
import android.net.Uri
import com.microsoft.graph.http.GraphServiceException
import com.microsoft.graph.models.DriveItem
import com.microsoft.graph.models.DriveItemCreateUploadSessionParameterSet
@ -86,7 +85,7 @@ internal class OnedriveImpl(cloud: OnedriveCloud, context: Context, graphService
private fun childByName(parentId: String, parentDriveId: String, name: String): DriveItem? {
return try {
drive(parentDriveId).items(parentId).itemWithPath(Uri.encode(name)).buildRequest().get()
drive(parentDriveId).items(parentId).itemWithPath(name).buildRequest().get()
} catch (e: GraphServiceException) {
if (isNotFoundError(e)) {
null