mirror of
https://github.com/kubeshark/kubeshark.git
synced 2025-06-29 01:30:37 +00:00
Remove SetHostname
method in HTTP extension (#496)
This commit is contained in:
parent
12ca3d8779
commit
d66c7445e6
@ -124,15 +124,6 @@ func (d dissecting) Dissect(b *bufio.Reader, isClient bool, tcpID *api.TcpID, co
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
func SetHostname(address, newHostname string) string {
|
|
||||||
replacedUrl, err := url.Parse(address)
|
|
||||||
if err != nil {
|
|
||||||
return address
|
|
||||||
}
|
|
||||||
replacedUrl.Host = newHostname
|
|
||||||
return replacedUrl.String()
|
|
||||||
}
|
|
||||||
|
|
||||||
func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, resolvedDestination string) *api.MizuEntry {
|
func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string, resolvedDestination string) *api.MizuEntry {
|
||||||
var host, authority, path, service string
|
var host, authority, path, service string
|
||||||
|
|
||||||
@ -189,9 +180,9 @@ func (d dissecting) Analyze(item *api.OutputChannelItem, resolvedSource string,
|
|||||||
reqDetails["queryString"] = mapSliceRebuildAsMap(reqDetails["_queryString"].([]interface{}))
|
reqDetails["queryString"] = mapSliceRebuildAsMap(reqDetails["_queryString"].([]interface{}))
|
||||||
|
|
||||||
if resolvedDestination != "" {
|
if resolvedDestination != "" {
|
||||||
service = SetHostname(service, resolvedDestination)
|
service = resolvedDestination
|
||||||
} else if resolvedSource != "" {
|
} else if resolvedSource != "" {
|
||||||
service = SetHostname(service, resolvedSource)
|
service = resolvedSource
|
||||||
}
|
}
|
||||||
|
|
||||||
method := reqDetails["method"].(string)
|
method := reqDetails["method"].(string)
|
||||||
|
Loading…
Reference in New Issue
Block a user