Skip to content

Commit 97ddb0b

Browse files
committed
fix: host JSON field now returns hostname instead of IP
- 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
1 parent 8b04cd9 commit 97ddb0b

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

runner/runner.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2326,7 +2326,8 @@ retry:
23262326
Pipeline: pipeline,
23272327
HTTP2: http2,
23282328
Method: method,
2329-
Host: ip,
2329+
Host: parsed.Hostname(),
2330+
HostIP: ip,
23302331
A: ips4,
23312332
AAAA: ips6,
23322333
CNAMEs: cnames,

runner/types.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ type Result struct {
5959
ContentType string `json:"content_type,omitempty" csv:"content_type" mapstructure:"content_type"`
6060
Method string `json:"method,omitempty" csv:"method" mapstructure:"method"`
6161
Host string `json:"host,omitempty" csv:"host" mapstructure:"host"`
62+
HostIP string `json:"host_ip,omitempty" csv:"host_ip" mapstructure:"host_ip"`
6263
Path string `json:"path,omitempty" csv:"path" mapstructure:"path"`
6364
FavIconMMH3 string `json:"favicon,omitempty" csv:"favicon" mapstructure:"favicon"`
6465
FavIconMD5 string `json:"favicon_md5,omitempty" csv:"favicon_md5" mapstructure:"favicon_md5"`

0 commit comments

Comments
 (0)