mirror of
https://github.com/cheikh2shift/godex.git
synced 2026-10-23 11:22:18 -05:00
fix: enhance command retrieval in runCommand function
This commit is contained in:
1 parent
5e85904f78
commit
86b506765c
1 file changed
+6
-1
@@ -346,7 +346,12 @@ func (s *BashServer) isPathAllowed(path string) bool {
|
||||
func (s *BashServer) runCommand(ctx context.Context, args map[string]any) (string, error) {
|
||||
command, ok := args["command"].(string)
|
||||
if !ok {
|
||||
return "", fmt.Errorf("command is required")
|
||||
|
||||
command, ok = args["cmd"].(string)
|
||||
|
||||
if !ok {
|
||||
return "", fmt.Errorf("command is required")
|
||||
}
|
||||
}
|
||||
|
||||
if !s.isCommandAllowed(command) {
|
||||
|
||||
Reference in new issue
Block a user