From b9ed2bec74405c620cdd3355caaad48a9fcc9995 Mon Sep 17 00:00:00 2001 From: Ashwin Bhat Date: Fri, 11 Oct 2024 08:48:17 -0700 Subject: [PATCH] encoding/decoding uri component --- client/src/App.tsx | 6 +++--- server/src/index.ts | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/src/App.tsx b/client/src/App.tsx index aeb3ff0..deba38d 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -173,10 +173,10 @@ const App = () => { backendUrl.searchParams.append("transportType", transportType); if (transportType === "stdio") { - backendUrl.searchParams.append("command", encodeURIComponent(command)); - backendUrl.searchParams.append("args", encodeURIComponent(args)); + backendUrl.searchParams.append("command", command); + backendUrl.searchParams.append("args", args); } else { - backendUrl.searchParams.append("url", encodeURIComponent(url)); + backendUrl.searchParams.append("url", url); } await clientTransport.connect(backendUrl); diff --git a/server/src/index.ts b/server/src/index.ts index 2ac006c..ba4a4f4 100644 --- a/server/src/index.ts +++ b/server/src/index.ts @@ -22,15 +22,15 @@ const createTransport = async (query: express.Request["query"]) => { const transportType = query.transportType as string; if (transportType === "stdio") { - const command = decodeURIComponent(query.command as string); - const args = decodeURIComponent(query.args as string).split(","); + const command = query.command as string; + const args = (query.args as string).split(","); console.log(`Stdio transport: command=${command}, args=${args}`); const transport = new StdioClientTransport(); await transport.spawn({ command, args }); console.log("Spawned stdio transport"); return transport; } else if (transportType === "sse") { - const url = decodeURIComponent(query.url as string); + const url = query.url as string; console.log(`SSE transport: url=${url}`); const transport = new SSEClientTransport(); await transport.connect(new URL(url));