mirror of
https://github.com/DumbWareio/DumbDrop.git
synced 2026-02-19 23:52:36 +08:00
(#73) * fix: resolve file disappearance with Docker bind mounts Files were disappearing when using bind mounts because fs.realpathSync() requires files to exist. Updated path validation to use path.resolve() for non-existing files (during upload) and fs.realpathSync() only for existing files (during operations). - Add isPathWithinUploadDir() to fileUtils with requireExists parameter - Update files.js to use shared validation function - Add path validation to upload.js for all file operations - Add comprehensive test suite (16 tests, all passing) - Maintain security against path traversal attacks - Full backward compatibility with named volumes Fixes: Files disappearing with bind mounts Related: d69a8b2, fc8bff9" * Improve file existence check in isPathWithinUploadDir Refines logic to immediately return false if requireExists is true and the file does not exist, ensuring more robust handling of non-existent files. * Bump version to 1.0.1 Update package version from 1.0.0 to 1.0.1 in preparation for a new release.