mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-09-17 15:21:54 +00:00
Fix a 500
error caused by an interface conversion in Redis (#308)
This commit is contained in:
@@ -24,27 +24,27 @@ type RedisWrapper struct {
|
|||||||
Details interface{} `json:"details"`
|
Details interface{} `json:"details"`
|
||||||
}
|
}
|
||||||
|
|
||||||
func representGeneric(generic map[string]string) (representation []interface{}) {
|
func representGeneric(generic map[string]interface{}) (representation []interface{}) {
|
||||||
details, _ := json.Marshal([]map[string]string{
|
details, _ := json.Marshal([]map[string]string{
|
||||||
{
|
{
|
||||||
"name": "Type",
|
"name": "Type",
|
||||||
"value": generic["type"],
|
"value": generic["type"].(string),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Command",
|
"name": "Command",
|
||||||
"value": generic["command"],
|
"value": generic["command"].(string),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Key",
|
"name": "Key",
|
||||||
"value": generic["key"],
|
"value": generic["key"].(string),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Value",
|
"name": "Value",
|
||||||
"value": generic["value"],
|
"value": generic["value"].(string),
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "Keyword",
|
"name": "Keyword",
|
||||||
"value": generic["keyword"],
|
"value": generic["keyword"].(string),
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
representation = append(representation, map[string]string{
|
representation = append(representation, map[string]string{
|
||||||
|
@@ -141,8 +141,8 @@ func (d dissecting) Represent(entry *api.MizuEntry) (p api.Protocol, object []by
|
|||||||
representation := make(map[string]interface{}, 0)
|
representation := make(map[string]interface{}, 0)
|
||||||
request := root["request"].(map[string]interface{})["payload"].(map[string]interface{})
|
request := root["request"].(map[string]interface{})["payload"].(map[string]interface{})
|
||||||
response := root["response"].(map[string]interface{})["payload"].(map[string]interface{})
|
response := root["response"].(map[string]interface{})["payload"].(map[string]interface{})
|
||||||
reqDetails := request["details"].(map[string]string)
|
reqDetails := request["details"].(map[string]interface{})
|
||||||
resDetails := response["details"].(map[string]string)
|
resDetails := response["details"].(map[string]interface{})
|
||||||
repRequest := representGeneric(reqDetails)
|
repRequest := representGeneric(reqDetails)
|
||||||
repResponse := representGeneric(resDetails)
|
repResponse := representGeneric(resDetails)
|
||||||
representation["request"] = repRequest
|
representation["request"] = repRequest
|
||||||
|
Reference in New Issue
Block a user