MCPcopy
hub / github.com/bettercap/bettercap / showHID

Method showHID

modules/api_rest/api_rest_controller.go:149–160  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

147}
148
149func (mod *RestAPI) showHID(w http.ResponseWriter, r *http.Request) {
150 params := mux.Vars(r)
151 mac := strings.ToLower(params["mac"])
152
153 if mac == "" {
154 mod.toJSON(w, mod.Session.HID)
155 } else if dev, found := mod.Session.HID.Get(mac); found {
156 mod.toJSON(w, dev)
157 } else {
158 http.Error(w, "Not Found", 404)
159 }
160}
161
162func (mod *RestAPI) showEnv(w http.ResponseWriter, r *http.Request) {
163 mod.toJSON(w, mod.Session.Env)

Callers 1

sessionRouteMethod · 0.95

Calls 3

toJSONMethod · 0.95
GetMethod · 0.45
ErrorMethod · 0.45

Tested by

no test coverage detected