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.
@@ -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(() => "");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "doer-agent",
3
- "version": "0.4.3",
3
+ "version": "0.4.4",
4
4
  "description": "Reverse-polling agent runtime for doer",
5
5
  "type": "module",
6
6
  "main": "dist/agent.js",