Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion src/onedrive.d
Original file line number Diff line number Diff line change
Expand Up @@ -1004,8 +1004,12 @@ class OneDriveApi {

// https://learn.microsoft.com/en-us/onedrive/developer/rest-api/api/driveitem_search
JSONValue searchDriveForPath(string driveId, string path) {
// OData string literal escaping: a single quote inside a '...' literal becomes doubled.
// Then URL-encode for safe transport
auto odataSafe = path.replace("'", "''");
auto encoded = encodeComponent(odataSafe);
string url;
url = "https://graph.microsoft.com/v1.0/drives/" ~ driveId ~ "/root/search(q='" ~ encodeComponent(path) ~ "')";
url = "https://graph.microsoft.com/v1.0/drives/" ~ driveId ~ "/root/search(q='" ~ encoded ~ "')";
return get(url);
}

Expand Down
Loading