fix: restore original migration, rename pathAfterAgent → pathAfterClient

- wrangler.toml: keep first migration as AgentSocket (already applied),
  second migration handles the rename
- index.ts: pathAfterAgent → pathAfterClient
This commit is contained in:
2026-05-13 23:26:20 +08:00
parent 236c771e4e
commit 238a94f7a6
2 changed files with 4 additions and 4 deletions
+3 -3
View File
@@ -288,9 +288,9 @@ app.all("/api/clients/:client/*", async (c) => {
}
const url = new URL(c.req.url);
const pathAfterAgent = url.pathname.replace(`/api/clients/${client}`, "");
const targetUrl = `${record.url}/api${pathAfterAgent}${url.search}`;
const proxyPath = `/api${pathAfterAgent}${url.search}`;
const pathAfterClient = url.pathname.replace(`/api/clients/${client}`, "");
const targetUrl = `${record.url}/api${pathAfterClient}${url.search}`;
const proxyPath = `/api${pathAfterClient}${url.search}`;
const method = c.req.method;
const token = record.clientToken ?? "";
const forwardRecord = buildForwardHeaders(c.req.raw.headers, token);
+1 -1
View File
@@ -11,7 +11,7 @@ bindings = [{ name = "CLIENT_SOCKET", class_name = "ClientSocket" }]
[[migrations]]
tag = "add-agent-socket"
new_sqlite_classes = ["ClientSocket"]
new_sqlite_classes = ["AgentSocket"]
[[migrations]]
tag = "rename-agent-to-client"