mirror of
https://github.com/bettercap/bettercap
synced 2025-08-14 02:36:57 -07:00
fix: exposing session modules as a map in api.rest for quick lookup
This commit is contained in:
parent
ba4793f980
commit
49aeb37b5c
1 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ type moduleJSON struct {
|
|||
}
|
||||
|
||||
func (mm ModuleList) MarshalJSON() ([]byte, error) {
|
||||
mods := []moduleJSON{}
|
||||
mods := make(map[string]moduleJSON)
|
||||
for _, m := range mm {
|
||||
mJSON := moduleJSON{
|
||||
Name: m.Name(),
|
||||
|
@ -50,7 +50,7 @@ func (mm ModuleList) MarshalJSON() ([]byte, error) {
|
|||
Running: m.Running(),
|
||||
State: m.Extra(),
|
||||
}
|
||||
mods = append(mods, mJSON)
|
||||
mods[m.Name()] = mJSON
|
||||
}
|
||||
return json.Marshal(mods)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue