validate model path

This commit is contained in:
Michael Yang 2024-08-27 17:56:04 -07:00
parent 6c1c1ad6a9
commit d9d50c43cc
2 changed files with 13 additions and 13 deletions

View file

@ -1,6 +1,7 @@
package server
import (
"errors"
"os"
"path/filepath"
"testing"
@ -154,3 +155,10 @@ func TestParseModelPath(t *testing.T) {
})
}
}
func TestInsecureModelpath(t *testing.T) {
mp := ParseModelPath("../../..:something")
if _, err := mp.GetManifestPath(); !errors.Is(err, errModelPathInvalid) {
t.Errorf("expected error: %v", err)
}
}