-
-
Notifications
You must be signed in to change notification settings - Fork 79.1k
Remote media URL fallback filenames keep percent escapes #84050
Copy link
Copy link
Closed
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Metadata
Metadata
Assignees
Labels
P2Normal backlog priority with limited blast radius.Normal backlog priority with limited blast radius.clawsweeper:fix-shape-clearClawSweeper found a clear likely implementation shape for this issue.ClawSweeper found a clear likely implementation shape for this issue.clawsweeper:linked-pr-openClawSweeper found an open linked pull request for this issue.ClawSweeper found an open linked pull request for this issue.clawsweeper:no-new-fix-prClawSweeper does not recommend queueing a new automated fix PR for this issue.ClawSweeper does not recommend queueing a new automated fix PR for this issue.clawsweeper:queueable-fixClawSweeper marked this issue as an existing queue_fix_pr work candidate.ClawSweeper marked this issue as an existing queue_fix_pr work candidate.clawsweeper:source-reproClawSweeper found a high-confidence source-level issue reproduction.ClawSweeper found a high-confidence source-level issue reproduction.issue-rating: 🦞 diamond lobsterVery strong issue quality with high-confidence source-level or clear reproduction.Very strong issue quality with high-confidence source-level or clear reproduction.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Bug type
Bug
Summary
Remote media fetched from an HTTP URL can surface a percent-encoded URL path basename as the filename when there is no
Content-Dispositionfilename or callerfilePathHint.For example, a URL like:
is exposed as:
instead of:
Steps to reproduce
On current
main, the URL fallback insrc/media/fetch.tsparsesfinalUrl, readsparsed.pathname, and passes that pathname directly tobasenameFromAnyPath.URL.pathnamepreserves percent escapes, so the fallback filename remains encoded:returns
/files/My%20Report.pdf, and the saved/read media filename becomesMy%20Report.pdf.Expected behavior
The URL path basename fallback should decode valid percent escapes before exposing the filename, so ordinary URL-safe filenames such as
My%20Report.pdfbecomeMy Report.pdf.Actual behavior
The raw encoded path basename is exposed as the media filename.
Impact
Agents and chat integrations that rely on OpenClaw's remote media filename fallback can show or forward URL-encoded filenames to users. This is visible whenever the remote response lacks a filename-bearing
Content-Dispositionheader and the caller does not provide a filename hint.Duplicate check
I searched current open issues and PRs for:
remote media filenameremote URL filenameURL filename percent encodedpercent-encoded filenamesrc/media/fetch.ts filenameI found related closed Feishu/local-file filename issues such as #44988, #43840, and #31179, plus closed Feishu PRs such as #43916, #43860, and #43983. Those cover Feishu upload/download/local-file filename handling; I did not find an open issue or PR for the generic remote media URL fallback in
src/media/fetch.ts.