@devries-cameron20 / composio-1 / commits / 9c211c770
Fork 0

Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.

fix(docs): treat unreadable public paths as missing links

statSync throws on paths such as `%00`, which aborted the link report instead of reporting the link. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Shashwat [zen] committed Oct 28, 2026 at 17:33 UTC 9c211c7703825838408867856e0fb6b2c60cf5b6
2 files changed +6 -1
docs/scripts/validate-links.ts
+5 -1
@@ -47,7 +47,11 @@ export function isPublicFileUrl(url: string, publicDir = 'public'): boolean {
47 const target = resolve(root, '.' + pathname);
48 const inside = relative(root, target);
49 if (!inside || inside.startsWith('..')) return false;
50 - return statSync(target, { throwIfNoEntry: false })?.isFile() ?? false;
50 + try {
51 + return statSync(target, { throwIfNoEntry: false })?.isFile() ?? false;
52 + } catch {
53 + return false;
54 + }
55 }
56
57 export function withoutFrontmatter(content: string): string {
docs/tests/static/validate-links.test.ts
+1
@@ -22,6 +22,7 @@ describe('link validation', () => {
22 expect(linkValidation.isPublicFileUrl('/%2e%2e/package.json')).toBe(false);
23 expect(linkValidation.isPublicFileUrl('//example.com/robots.txt')).toBe(false);
24 expect(linkValidation.isPublicFileUrl('/%E0%A4%A.py')).toBe(false);
25 + expect(linkValidation.isPublicFileUrl('/assets/file%00.py')).toBe(false);
26 });
27
28 test('accepts redirecting toolkit knowledge routes as resolvable links', async () => {