Baike.dev
All toolsAI codingTrendingOpen sourceNewsSubmit
Log in
Back to tool/Back to issues
#1170·remotely-save

[Bug]: OneDrive HTTP 400 workaround / OneDrive 报 HTTP 400 的临时解决方法

Author: VsxbambooCreated May 14, 2026Updated Sep 3, 2026
Labelsbug

What happened?

Some users may encounter HTTP 400 errors when Remotely Save 0.5.25 connects to OneDrive on recent Obsidian versions.

A fork has a small workaround:

https://github.com/Deadbush225/remotely-save

Relevant commit:

https://github.com/Deadbush225/remotely-save/commit/eaea5f118e44faa04ae9ed1e6e81da1792cb4df0

The change is limited to the OneDrive request layer:

  • src/fsOnedrive.ts
  • pro/src/fsOnedriveFull.ts

It replaces Obsidian request() with requestUrl() for:

  • OAuth authorization code exchange
  • refresh token exchange
  • Microsoft Graph JSON GET/POST/PATCH requests

Example change:

diff
-import { request, requestUrl } from "obsidian";
+import { requestUrl } from "obsidian";

-const rsp1 = await request({
+const rsp1 = await requestUrl({
   url: `${authority}/oauth2/v2.0/token`,
   method: "POST",
   contentType: "application/x-www-form-urlencoded",
   body: new URLSearchParams({
     tenant: "consumers",
     client_id: clientID,
     scope: SCOPES.join(" "),
     code: authCode,
     redirect_uri: REDIRECT_URI,
     grant_type: "authorization_code",
     code_verifier: verifier,
   }).toString(),
 });

-const rsp2 = JSON.parse(rsp1);
+const rsp2 = rsp1.json;

Example Microsoft Graph JSON request change:

diff
-return JSON.parse(
-  await request({
-    url: theUrl,
-    method: "GET",
-    contentType: "application/json",
-    headers: {
-      Authorization: `Bearer ${await this.authGetter.getAccessToken()}`,
-      "Cache-Control": "no-cache",
-    },
-  })
-);
+const res = await requestUrl({
+  url: theUrl,
+  method: "GET",
+  contentType: "application/json",
+  headers: {
+    Authorization: `Bearer ${await this.authGetter.getAccessToken()}`,
+    "Cache-Control": "no-cache",
+  },
+});
+return res.json;

The same pattern is also applied to Graph JSON POST and PATCH calls.

I tested a local patched build by replacing only:

.obsidian/plugins/remotely-save/main.js

After restarting Obsidian, OneDrive sync completed successfully.

What OS are you using?

Windows

What remote cloud services are you using? (Please choose the specified one if it's in the list)

OneDrive for personal

Version of the plugin

0.5.25

Version of Obsidian

1.12.7

Using password or not

  • Yes.

Ensure no sensitive information

  • I ensure that no sensitive information is submitted in the issue.

Source: remotely-save/remotely-save

View original on GitHubView discussion on GitHub