We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13814ba commit 1937bffCopy full SHA for 1937bff
mcp-server/src/services/mcp.ts
@@ -653,8 +653,12 @@ export const createMcpServer = (): McpServerWrapper => {
653
const { files, outputType } = ZipResourcesInputSchema.parse(args);
654
const zip = new JSZip();
655
656
- for (const [fileName, fileUrl] of Object.entries(files)) {
+ for (const [fileName, fileUrlString] of Object.entries(files)) {
657
try {
658
+ const fileUrl = new URL(fileUrlString);
659
+ if (fileUrl.protocol !== 'http:' && fileUrl.protocol !== 'https:' && fileUrl.protocol !== 'data:') {
660
+ throw new Error(`Unsupported URL protocol for ${fileUrlString}. Only http, https, and data URLs are supported.`);
661
+ }
662
const response = await fetch(fileUrl);
663
if (!response.ok) {
664
throw new Error(
0 commit comments