fix(WebServer): fix file transfer handling for paths with spaces#6
Merged
FASTSHIFT merged 1 commit intoFASTSHIFT:mainfrom Mar 3, 2026
Merged
Conversation
2d30fdc to
e785ecd
Compare
There was a problem hiding this comment.
Pull request overview
This PR fixes WebServer file transfer failures when remote paths contain spaces by quoting --path/--newpath arguments in FileTransfer commands and updating fstat response parsing to handle spaced paths, with accompanying test updates and a new test suite.
Changes:
- Quote file path arguments for
fopen/fstat/flist/fremove/fmkdir/frenamecommand generation. - Update
fstatparsing regex to capture paths that may contain spaces. - Add/adjust unit tests to validate path quoting behavior.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| Tools/WebServer/core/file_transfer.py | Quotes --path arguments and adjusts fstat parsing to support spaced paths. |
| Tools/WebServer/tests/test_file_transfer.py | Updates rename test expectation to match newly quoted paths. |
| Tools/WebServer/tests/test_file_transfer_spaces.py | Adds tests covering file operations where paths include spaces. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e785ecd to
23eef4a
Compare
…prevent command injection - Add path sanitization to reject control characters (\r, \n) - Escape double quotes in paths to prevent command injection - Add comprehensive security tests for path validation - All 128 tests pass
23eef4a to
8d33b71
Compare
FASTSHIFT
approved these changes
Mar 3, 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.
Fix: File Transfer Handling for Paths with Spaces
Problem
The file transfer module failed to correctly handle file pathscontaining spaces, causing transfer failures when uploading/downloading files with spaces in their names or paths.
Changes
Testing
All new tests pass, ensuring robust handling of:
Impact