mirror of
https://github.com/YspCoder/clawgo.git
synced 2026-04-29 05:31:06 +08:00
fix package
This commit is contained in:
@@ -46,13 +46,13 @@ func (t *CameraTool) Execute(ctx context.Context, args map[string]interface{}) (
|
||||
} else {
|
||||
filename = fmt.Sprintf("snap_%d.jpg", time.Now().Unix())
|
||||
}
|
||||
|
||||
|
||||
// Ensure filename is safe and within workspace
|
||||
filename = filepath.Clean(filename)
|
||||
if filepath.IsAbs(filename) {
|
||||
return "", fmt.Errorf("filename must be relative to workspace")
|
||||
}
|
||||
|
||||
|
||||
outputPath := filepath.Join(t.workspace, filename)
|
||||
|
||||
// Check if video device exists
|
||||
|
||||
Reference in New Issue
Block a user