Fix some issues

This commit is contained in:
M. Mert Yildiran 2021-09-17 21:53:09 +03:00
parent ad5fd161ec
commit f40228bcc4
No known key found for this signature in database
GPG Key ID: D42ADB236521BF7A
4 changed files with 8 additions and 7 deletions

View File

@ -75,6 +75,8 @@ func main() {
rlog.Infof("Filtering for the following authorities: %v", tap.GetFilterIPs())
}
time.Sleep(2 * time.Second)
// harOutputChannel, outboundLinkOutputChannel := tap.StartPassiveTapper(tapOpts)
filteredOutputItemsChannel := make(chan *tapApi.OutputChannelItem)
tap.StartPassiveTapper(tapOpts, filteredOutputItemsChannel, extensions)

View File

@ -41,11 +41,7 @@ func init() {
func WebSocketRoutes(app *gin.Engine, eventHandlers EventHandlers) {
app.GET("/ws", func(c *gin.Context) {
queryMap := c.Request.URL.Query()
query := ""
if val, ok := queryMap["q"]; ok {
query = val[0]
}
query := c.DefaultQuery("q", "")
websocketHandlerUI(c.Writer, c.Request, eventHandlers, false, query)
})
app.GET("/wsTapper", func(c *gin.Context) {

View File

@ -139,6 +139,10 @@ func GetEntry(c *gin.Context) {
id, _ := strconv.Atoi(c.Param("entryId"))
fmt.Printf("GetEntry id: %v\n", id)
entry := api.Single(uint(id))
var response map[string]interface{}
if entry["response"] != nil {
response = entry["response"].(map[string]interface{})
}
entryData := tapApi.MizuEntry{
Protocol: tapApi.Protocol{
Name: entry["proto"].(map[string]interface{})["name"].(string),
@ -152,7 +156,7 @@ func GetEntry(c *gin.Context) {
Priority: uint8(entry["proto"].(map[string]interface{})["priority"].(float64)),
},
Request: entry["request"].(map[string]interface{}),
Response: entry["response"].(map[string]interface{}),
Response: response,
EntryId: entry["entryId"].(string),
Entry: entry["entry"].(string),
Url: entry["url"].(string),

View File

@ -269,7 +269,6 @@ func (d dissecting) Analyze(item *api.OutputChannelItem, entryId string, resolve
return &api.MizuEntry{
Protocol: protocol,
Request: reqDetails,
Response: item.Pair.Response.Payload.(map[string]interface{})["details"].(map[string]interface{}),
EntryId: entryId,
Entry: string(entryBytes),
Url: fmt.Sprintf("%s%s", service, summary),