Skip to content

Commit 3f953c9

Browse files
committed
Fix Bug #3772: Fix hardcoded Microsoft Graph endpoint usage in SharePoint drive search handling
`searchDriveForPath()` was still constructing the drive search URL with the commercial Graph endpoint, `https://graph.microsoft.com/v1.0`, instead of using the configured Graph base URL. This caused GCC High / US Government tenants using `graph.microsoft.us` to incorrectly jump back to the commercial endpoint during local file or directory creation checks, resulting in `401 Unauthorized` responses. The fix changes the URL construction to use `driveByIdUrl`, ensuring the search request honours the configured national-cloud endpoint. ([GitHub][1])
1 parent 0b7299a commit 3f953c9

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

src/onedrive.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1609,7 +1609,7 @@ class OneDriveApi {
16091609
auto odataSafe = path.replace("'", "''");
16101610
auto encoded = encodeComponent(odataSafe);
16111611
string url;
1612-
url = "https://graph.microsoft.com/v1.0/drives/" ~ driveId ~ "/root/search(q='" ~ encoded ~ "')";
1612+
url = driveByIdUrl ~ driveId ~ "/root/search(q='" ~ encoded ~ "')";
16131613
return get(url);
16141614
}
16151615

0 commit comments

Comments
 (0)