doer-agent 0.3.2 → 0.3.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.js +2 -1
- package/package.json +1 -1
package/dist/agent.js
CHANGED
|
@@ -2596,12 +2596,13 @@ async function executeFsRpc(args) {
|
|
|
2596
2596
|
if (!uploadUrl || !agentId) {
|
|
2597
2597
|
throw new Error("missing upload parameters");
|
|
2598
2598
|
}
|
|
2599
|
+
const resolvedUploadUrl = new URL(uploadUrl, `${args.serverBaseUrl}/`).toString();
|
|
2599
2600
|
const data = await readFile(abs);
|
|
2600
2601
|
const fileName = path.basename(abs) || "file";
|
|
2601
2602
|
const form = new FormData();
|
|
2602
2603
|
form.append("file", new File([data], fileName));
|
|
2603
2604
|
form.append("agentId", agentId);
|
|
2604
|
-
const response = await fetch(
|
|
2605
|
+
const response = await fetch(resolvedUploadUrl, {
|
|
2605
2606
|
method: "POST",
|
|
2606
2607
|
headers: { Authorization: `Bearer ${args.agentToken}` },
|
|
2607
2608
|
body: form,
|