mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-24 15:24:17 +00:00
Add source and destination info when fetching entries (x-mizu-fields) (#93)
This commit is contained in:
parent
1137f9386b
commit
eef58496b5
@ -63,6 +63,14 @@ func GetEntriesFromDb(timestampFrom int64, timestampTo int64) []har.Entry {
|
||||
for _, entryData := range entries {
|
||||
var harEntry har.Entry
|
||||
_ = json.Unmarshal([]byte(entryData.Entry), &harEntry)
|
||||
|
||||
if entryData.ResolvedSource != "" {
|
||||
harEntry.Request.Headers = append(harEntry.Request.Headers, har.Header{Name: "x-mizu-source", Value: entryData.ResolvedSource})
|
||||
}
|
||||
if entryData.ResolvedDestination != "" {
|
||||
harEntry.Request.Headers = append(harEntry.Request.Headers, har.Header{Name: "x-mizu-destination", Value: entryData.ResolvedDestination})
|
||||
}
|
||||
|
||||
entriesArray = append(entriesArray, harEntry)
|
||||
}
|
||||
return entriesArray
|
||||
|
Loading…
Reference in New Issue
Block a user