encoding/decoding uri component
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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));
|
||||
|
||||
Reference in New Issue
Block a user