豆豆友情提示:这是一个非官方 GitHub 代理镜像,主要用于网络测试或访问加速。请勿在此进行登录、注册或处理任何敏感信息。进行这些操作请务必访问官方网站 github.com。 Raw 内容也通过此代理提供。
Skip to content

feat: ensure extensions for file outputs#1867

Merged
OrKoN merged 3 commits intomainfrom
orkon/ensure-extensions
Apr 16, 2026
Merged

feat: ensure extensions for file outputs#1867
OrKoN merged 3 commits intomainfrom
orkon/ensure-extensions

Conversation

@OrKoN
Copy link
Copy Markdown
Collaborator

@OrKoN OrKoN commented Apr 15, 2026

This PR ensures the extensions for the file outputs of different types minimizing the chance of misuse. The input filePath, thus, might be modified but it should not be an issue for clients as the final output path is returned to the clients in the response.

Closes #1864

@OrKoN OrKoN requested a review from Lightning00Blade April 15, 2026 13:38
@OrKoN OrKoN force-pushed the orkon/ensure-extensions branch 2 times, most recently from 8a1214e to 1d3179e Compare April 15, 2026 13:42
@OrKoN OrKoN force-pushed the orkon/ensure-extensions branch from 1d3179e to fd19710 Compare April 15, 2026 13:42
Copy link
Copy Markdown
Collaborator

@Lightning00Blade Lightning00Blade left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with comments

  • Did you miss the memory snapshot place?
  • Feature work: Should we ban the use of fs/path in the repo and create our wrappers to manage this in one place?

Comment thread src/utils/files.ts Outdated
Comment thread tests/utils/files.test.ts Outdated
Co-authored-by: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com>
@OrKoN
Copy link
Copy Markdown
Collaborator Author

OrKoN commented Apr 15, 2026

Did you miss the memory snapshot place?

Yep, fixed!

Feature work: Should we ban the use of fs/path in the repo and create our wrappers to manage this in one place?

Note sure, I think there could legitimate uses of fs/path but if we can lint all places where we read/write tools for tools (excluding daemons, cli, metrics). I think it would be great. Yeah maybe we can just ban it in tools/. With Puppeteer APIs it is not so straightforward.

Co-authored-by: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com>
@OrKoN OrKoN force-pushed the orkon/ensure-extensions branch from 171e42f to d2989b0 Compare April 15, 2026 14:50
@OrKoN OrKoN requested a review from Lightning00Blade April 15, 2026 14:50
@OrKoN OrKoN added this pull request to the merge queue Apr 16, 2026
Merged via the queue into main with commit e7a0d50 Apr 16, 2026
20 checks passed
@OrKoN OrKoN deleted the orkon/ensure-extensions branch April 16, 2026 06:16
beaufortfrancois pushed a commit to beaufortfrancois/chrome-devtools-mcp that referenced this pull request Apr 16, 2026
This PR ensures the extensions for the file outputs of different types
minimizing the chance of misuse. The input filePath, thus, might be
modified but it should not be an issue for clients as the final output
path is returned to the clients in the response.

Closes ChromeDevTools#1864

---------

Co-authored-by: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com>
wolfib pushed a commit that referenced this pull request Apr 16, 2026
This PR ensures the extensions for the file outputs of different types
minimizing the chance of misuse. The input filePath, thus, might be
modified but it should not be an issue for clients as the final output
path is returned to the clients in the response.

Closes #1864

---------

Co-authored-by: Nikolay Vitkov <34244704+Lightning00Blade@users.noreply.github.com>
github-merge-queue bot pushed a commit that referenced this pull request Apr 17, 2026
wolfib pushed a commit that referenced this pull request Apr 20, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enforce a file extension for files saved by the MCP server

2 participants