doer-agent 0.4.3 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/agent-fs-rpc.js +6 -3
- package/package.json +1 -1
package/dist/agent-fs-rpc.js
CHANGED
|
@@ -260,11 +260,14 @@ async function executeFsRpc(args) {
|
|
|
260
260
|
throw new Error("downloadPath is required");
|
|
261
261
|
}
|
|
262
262
|
const downloadUrl = new URL(downloadPath, `${args.serverBaseUrl}/`).toString();
|
|
263
|
+
const serverOrigin = new URL(args.serverBaseUrl).origin;
|
|
264
|
+
const headers = {};
|
|
265
|
+
if (new URL(downloadUrl).origin === serverOrigin) {
|
|
266
|
+
headers.Authorization = `Bearer ${args.agentToken}`;
|
|
267
|
+
}
|
|
263
268
|
const response = await fetch(downloadUrl, {
|
|
264
269
|
method: "GET",
|
|
265
|
-
headers
|
|
266
|
-
Authorization: `Bearer ${args.agentToken}`,
|
|
267
|
-
},
|
|
270
|
+
headers,
|
|
268
271
|
});
|
|
269
272
|
if (!response.ok) {
|
|
270
273
|
const text = await response.text().catch(() => "");
|