12 lines
299 B
Go
12 lines
299 B
Go
package platform
|
|
|
|
import "testing"
|
|
|
|
func TestValidateBrowsePathRejectsUnsafePaths(t *testing.T) {
|
|
for _, path := range []string{"", "/", "/etc", "/mnt/user/../../etc", "relative"} {
|
|
if _, err := validateBrowsePath(path); err == nil {
|
|
t.Fatalf("unsafe browse path accepted: %q", path)
|
|
}
|
|
}
|
|
}
|