chore: allow unsafe path for provider by environment variable

This commit is contained in:
Skyxim
2023-06-11 01:55:49 +00:00
parent 64b23257db
commit b72219c06a
3 changed files with 13 additions and 9 deletions

View File

@ -67,7 +67,7 @@ func ParseProxyProvider(name string, mapping map[string]any) (types.ProxyProvide
case "file":
vehicle = resource.NewFileVehicle(path)
case "http":
if !C.Path.IsSubPath(path) {
if !C.Path.IsSafePath(path) {
return nil, fmt.Errorf("%w: %s", errSubPath, path)
}
vehicle = resource.NewHTTPVehicle(schema.URL, path)