Tags: fogfish/stream
Tags
(fix) Inconsistent file path behaviour (#53) Key Changes: Updated shared validation functions (filename.go): IsValidFile(), IsValidPath(), and IsValidDir() now accept paths with or without leading / Both /file.txt and file.txt are treated as equivalent paths relative to the mount point Relative paths with .. are still rejected by fs.ValidPath() Both filesystems now behave identically: S3 filesystem (stream): Already had path normalization in s3Key() that strips leading / Local filesystem (lfs): Uses trim() function to normalize paths before filesystem operations Both accept the same path formats and treat them consistently Updated documentation: Both Create() and Open() methods in both filesystems now document that paths can be with or without leading / Clear that both forms are treated as paths relative to the mount point Before: Paths required leading / → fsys.Create("/file.txt", nil) ✅ Paths without / failed → fsys.Create("file.txt", nil) ❌ After: Both forms work equally → fsys.Create("/file.txt", nil) ✅ → fsys.Create("file.txt", nil) ✅ Both are treated as the same file at the mount root No support for relative traversal with ../ (correctly rejected)
PreviousNext