Skip to content

docs: keep only the last path component of downloaded file names - #2482

Open
vdusek wants to merge 3 commits into
masterfrom
docs/file-download-safe-name
Open

vdusek wants to merge 3 commits into
masterfrom
docs/file-download-safe-name

Conversation

@vdusek

@vdusek vdusek commented Nov 18, 2026 •

Copy link
Copy Markdown
Collaborator

The streaming file download example and the FileDownloadCrawler docstring built the output path from URL(context.request.url).name. yarl decodes %2F in URL.name, so a URL ending in ..%2F..%2Ffile.txt gave the name ../../file.txt, and the file was written outside the download directory. Both snippets now keep only the last path component with Path(...).name.

The streaming example also skips URLs whose file name is empty or .., and logs a warning.

✍️ Drafted by Claude Code

@vdusek vdusek added t-tooling Issues with this label are in the ownership of the tooling team. adhoc Ad-hoc unplanned task added during the sprint. labels Nov 18, 2026
@vdusek vdusek self-assigned this Nov 18, 2026
@codecov

codecov Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 94.23%. Comparing base (db01ddc) to head (bc29fc2).

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2482      +/-   ##
==========================================
+ Coverage   94.20%   94.23%   +0.03%     
==========================================
  Files         184      184              
  Lines       13690    13690              
==========================================
+ Hits        12896    12901       +5     
+ Misses        794      789       -5     
Flag Coverage Δ
integration 76.55% <ø> (+0.01%) ⬆️
unit 85.74% <ø> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@vdusek
vdusek marked this pull request as ready for review November 18, 2026 17:29
@vdusek
vdusek requested a review from janbuchar November 18, 2026 17:29

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant