Skip to content

Commit b9ed2be

Browse files
committed
encoding/decoding uri component
1 parent 14da479 commit b9ed2be

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

client/src/App.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,10 +173,10 @@ const App = () => {
173173

174174
backendUrl.searchParams.append("transportType", transportType);
175175
if (transportType === "stdio") {
176-
backendUrl.searchParams.append("command", encodeURIComponent(command));
177-
backendUrl.searchParams.append("args", encodeURIComponent(args));
176+
backendUrl.searchParams.append("command", command);
177+
backendUrl.searchParams.append("args", args);
178178
} else {
179-
backendUrl.searchParams.append("url", encodeURIComponent(url));
179+
backendUrl.searchParams.append("url", url);
180180
}
181181

182182
await clientTransport.connect(backendUrl);

server/src/index.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ const createTransport = async (query: express.Request["query"]) => {
2222
const transportType = query.transportType as string;
2323

2424
if (transportType === "stdio") {
25-
const command = decodeURIComponent(query.command as string);
26-
const args = decodeURIComponent(query.args as string).split(",");
25+
const command = query.command as string;
26+
const args = (query.args as string).split(",");
2727
console.log(`Stdio transport: command=${command}, args=${args}`);
2828
const transport = new StdioClientTransport();
2929
await transport.spawn({ command, args });
3030
console.log("Spawned stdio transport");
3131
return transport;
3232
} else if (transportType === "sse") {
33-
const url = decodeURIComponent(query.url as string);
33+
const url = query.url as string;
3434
console.log(`SSE transport: url=${url}`);
3535
const transport = new SSEClientTransport();
3636
await transport.connect(new URL(url));

0 commit comments

Comments
 (0)