fix: host JSON field now returns hostname instead of IP (#2333)

- Changed 'host' field to return actual hostname (e.g., example.com)
- Added new 'host_ip' field for the resolved/dialed IP address
- Fixes semantic issue where 'host' was incorrectly returning IP
This commit is contained in:
Sandeep Singh
2025-12-06 23:39:34 +05:30
committed by GitHub
parent 599441ef15
commit a00f9c4d0d
2 changed files with 3 additions and 1 deletions
+2 -1
View File
@@ -2330,7 +2330,8 @@ retry:
Pipeline: pipeline,
HTTP2: http2,
Method: method,
Host: ip,
Host: parsed.Hostname(),
HostIP: ip,
A: ips4,
AAAA: ips6,
CNAMEs: cnames,
+1
View File
@@ -59,6 +59,7 @@ type Result struct {
ContentType string `json:"content_type,omitempty" csv:"content_type" mapstructure:"content_type"`
Method string `json:"method,omitempty" csv:"method" mapstructure:"method"`
Host string `json:"host,omitempty" csv:"host" mapstructure:"host"`
HostIP string `json:"host_ip,omitempty" csv:"host_ip" mapstructure:"host_ip"`
Path string `json:"path,omitempty" csv:"path" mapstructure:"path"`
FavIconMMH3 string `json:"favicon,omitempty" csv:"favicon" mapstructure:"favicon"`
FavIconMD5 string `json:"favicon_md5,omitempty" csv:"favicon_md5" mapstructure:"favicon_md5"`