You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
-sandbox rejects files nested more than one directory deep #230
With -sandbox, any file more than one directory below the served root is rejected with "invalid file". In pkg/httpserver/sandboxfs.go the containment check matches the absolute path against a glob built from the root, and * does not cross path separators, so root/a/b.txt fails while root/b.txt works.
Expected Behavior:
Files anywhere under the sandbox root are served. Paths outside the root stay rejected.
Steps To Reproduce:
mkdir -p root/a/b && echo hi > root/a/b/f.txt
simplehttpserver -path root -sandbox
curl localhost:8000/a/b/f.txt returns "invalid file" instead of the content
Anything else:
A fail-first test in pkg/httpserver/sandboxfs_test.go covers nested files and outside-root rejection. Checking containment with filepath.Rel fixes it. I have a patch ready.
Activity