Decode URL-encoded zip entry names when extracting NuGet packages#116
Draft
Decode URL-encoded zip entry names when extracting NuGet packages#116
Conversation
Agent-Logs-Url: https://github.com/JustinGrote/ModuleFast/sessions/d72bd0f4-f6fb-4703-ad8d-33d3fb81f9cb Co-authored-by: JustinGrote <15258962+JustinGrote@users.noreply.github.com>
…st to cover directory entries Agent-Logs-Url: https://github.com/JustinGrote/ModuleFast/sessions/d72bd0f4-f6fb-4703-ad8d-33d3fb81f9cb Co-authored-by: JustinGrote <15258962+JustinGrote@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix file paths decoding during extraction
Decode URL-encoded zip entry names when extracting NuGet packages
Apr 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
NuGet packages percent-encode file paths in their zip entries (e.g. spaces →
%20).ZipFileExtensions.ExtractToDirectorydoes not decode these, resulting in files being written with names likefile%20with%20spaces.txton disk instead offile with spaces.txt.Changes
ModuleFast.psm1: Replace the singleExtractToDirectorycall with a manual loop that applies[Uri]::UnescapeDataStringto each entry'sFullNamebefore constructing the destination path, then extracts viaZipFileExtensions.ExtractToFile. Directory entries (both/and\terminators) are handled explicitly.ModuleFast.tests.ps1: Unit test added that builds an in-memory ZIP with percent-encoded directory and file entries, runs the extraction logic, and asserts decoded paths exist while encoded paths do not.