chore(deps): drop unused content-disposition dependency#4980
chore(deps): drop unused content-disposition dependency#4980aglinxinyuan merged 3 commits intoapache:mainfrom
Conversation
`download.service.ts` had a top-level
`var contentDisposition = require("content-disposition")` that was never read
or called. Removed the dead require, then dropped both `content-disposition`
and `@types/content-disposition` from package.json (and the bundled-license
roll-up). yarn.lock loses the transitive entries for free.
Closes apache#4979.
There was a problem hiding this comment.
Pull request overview
Removes an unused content-disposition require from the frontend download service and cleans up the corresponding direct dependencies and licensing manifests to keep the frontend dependency set lean.
Changes:
- Removed dead
require("content-disposition")fromdownload.service.ts. - Dropped
content-dispositionand@types/content-dispositionfromfrontend/package.json. - Updated
frontend/yarn.lockandfrontend/LICENSE-binaryto reflect the dependency cleanup.
Reviewed changes
Copilot reviewed 3 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
frontend/src/app/dashboard/service/user/download/download.service.ts |
Removes unused content-disposition require. |
frontend/package.json |
Deletes direct runtime + typings dependencies for content-disposition. |
frontend/LICENSE-binary |
Removes content-disposition@0.5.4 entry from the bundled license manifest. |
frontend/yarn.lock |
Regenerated lockfile reflecting dependency graph updates after removal. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…nsitives The 5 packages flagged by check_binary_deps.py (base64-js, buffer, ieee754, path-browserify, safe-buffer) were only bundled because content-disposition pulled them in transitively. Once content-disposition itself is gone, they fall out of the webpack bundle and the LICENSE-binary entries are stale.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4980 +/- ##
============================================
- Coverage 42.73% 42.73% -0.01%
+ Complexity 2187 2186 -1
============================================
Files 1031 1031
Lines 38153 38152 -1
Branches 4004 4004
============================================
- Hits 16305 16303 -2
Misses 20831 20831
- Partials 1017 1018 +1
*This pull request uses carry forward flags. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
@aglinxinyuan what was this used for? can we git blame to trace and report here? |
|
@Yicong-Huang traced it — short version: it was wired up in March, then orphaned in October when downloads moved to the browser. The
So it's been dead since Oct 10, 2025 — the package and its types just rode along until I noticed. Relevant blame on And the removed call site (added in public saveBlobFile(response: any, defaultFileName: string): void {
const dispositionHeader = response.headers.get("Content-Disposition");
let fileName = defaultFileName;
if (dispositionHeader) {
const parsed = contentDisposition.parse(dispositionHeader);
fileName = parsed.parameters.filename || defaultFileName;
}
...
}No other references to |
What changes were proposed in this PR?
download.service.tscarried a top-levelvar contentDisposition = require("content-disposition")that was never read or called. Removing the deadrequirelets us drop thecontent-dispositionruntime dep and its@types/content-dispositioncompanion, plus the now-stale bundled-license entries for the transitive packages that fell out with it (base64-js,buffer,ieee754,path-browserify,safe-buffer).Any related issues, documentation, discussions?
Closes #4979.
How was this PR tested?
yarn installsucceeds and rewritesyarn.lock(transitive entries fall away)yarn buildexits 0yarn teststays at 63 / 269 paritycheck_binary_deps.py --ignore-transitive-version npm …/3rdpartylicenses.jsonwill be the final arbiter on the LICENSE-binary cleanupWas this PR authored or co-authored using generative AI tooling?
Generated-by: Claude Code (Opus 4.7)