Skip to content

Allow downloading good files when forbidden keywords are found - #162

Merged
fregante merged 6 commits into
mainfrom
copilot/fix-download-error-message
May 13, 2026
Merged

fregante merged 6 commits into
mainfrom
copilot/fix-download-error-message

Conversation

Copilot AI commented May 13, 2026 •

Copy link
Copy Markdown
Contributor

Directory downloads were being fully blocked when any matched keyword (malware|virus|trojan) appeared, which breaks legitimate folders containing benign filenames like Malwarebytes.icns. This change scopes blocking to individual files and continues downloading the rest.

  • Behavior change: block only matching files

    • Replaced all-or-nothing path checks with per-file filtering before download.
    • For each excluded file, status now logs: File blocked: <path>.
    • Download proceeds with remaining files; if everything is filtered, status reports no downloadable files.
  • Additional UX status update

    • Adds a Google Safe Browsing warning status message:
      • ⚠ Some files were blocked due to Google Safe Browsing.
    • Per review feedback, this warning is shown after download completion (if some files were downloaded) or immediately before No files to download (if all files were filtered out).
    • Per-file blocked statuses are still shown for each excluded file.
  • Implementation details

    • Kept googleDoesntLikeThis in index.ts.
    • Uses a single inline pass with files = files.filter(...) and emits updateStatus(...) inside the filter callback.
    • Removed duplicate empty-list checks and retained a single No files to download check after filtering.
    • Tracks whether blocked files were found during filtering and emits the Google Safe Browsing warning at the final status stage.
  • Compatibility with current UX

    • Preserves existing download/zipping flow and status stream.
    • Keeps keyword policy intact while reducing false-positive impact.

@netlify

netlify Bot commented May 13, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for preview-for-download-directory-github-io ready!

Name Link
🔨 Latest commit d313157
🔍 Latest deploy log https://app.netlify.com/projects/preview-for-download-directory-github-io/deploys/6a043dde1214ea00088572a6
😎 Deploy Preview https://deploy-preview-162--preview-for-download-directory-github-io.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

Copilot AI changed the title [WIP] Fix error message for malware detection on file downloads Filter malware-keyword matches per file instead of aborting directory downloads May 13, 2026
Copilot AI requested a review from fregante May 13, 2026 08:25
Comment thread index.ts Resolved
Comment thread index.ts Resolved
Comment thread index.ts Resolved

Copilot AI commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • fonts.googleapis.com
    • Triggering command: /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1223/chrome-headless-shell-linux64/chrome-headless-shell /home/REDACTED/.cache/ms-playwright/chromium_headless_shell-1223/chrome-headless-shell-linux64/chrome-headless-shell --disable-field-trial-config --disable-REDACTED-networking --disable-REDACTED-timer-throttling --disable-REDACTEDing-occluded-windows --disable-back-forward-cache --disable-breakpad --disable-client-side-phishing-detection --disable-component-extensions-with-REDACTED-pages --disable-component-update --no-default-browser-check --disable-default-apps --disable-dev-shm-usage --disable-edgeupdater --disable-extensions --disable-features=AvoidUnnecessaryBeforeUnloadCheckSync,BoundaryEventDispatchTracksNodeRemoval,DestroyProfileOnBrowserClose,DialMediaRouteProvider,GlobalMediaControls,HttpsUpgrades,LensOverlay,MediaRouter,PaintHolding,ThirdPartyStoragePartitioning,Transl (dns block)
  • https://api.github.com/repos/refined-github/sandbox
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node --conditions development --conditions node /home/REDACTED/work/download-directory.github.io/download-directory.github.io/node_modules/tinypool/dist/entry/process.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from fregante May 13, 2026 08:35
Comment thread index.ts Resolved

Copilot AI commented May 13, 2026

Copy link
Copy Markdown
Contributor Author

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/refined-github/sandbox
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node --conditions development --conditions node /home/REDACTED/work/download-directory.github.io/download-directory.github.io/node_modules/tinypool/dist/entry/process.js (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI requested a review from fregante May 13, 2026 08:50
Comment thread index.ts Resolved
Copilot AI requested a review from fregante May 13, 2026 09:04
@fregante
fregante marked this pull request as ready for review May 13, 2026 09:06
@fregante fregante changed the title Filter malware-keyword matches per file instead of aborting directory downloads Allow downloading good files when forbidden keywords are found May 13, 2026
@fregante

Copy link
Copy Markdown
Member
Screenshot 12 Screenshot 13

@fregante
fregante merged commit 1d42144 into main May 13, 2026
6 checks passed
@fregante
fregante deleted the copilot/fix-download-error-message branch May 13, 2026 09:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

Site returns error: "Virus, malware, trojans not allowed" incorrectly

2 participants