diff --git a/core/condition.go b/core/condition.go index 220b9307..65c744f8 100644 --- a/core/condition.go +++ b/core/condition.go @@ -22,10 +22,10 @@ const ( // Values that could replace the placeholder: 127.0.0.1, 10.0.0.1, ... IPPlaceholder = "[IP]" - // DNSRCodePlaceHolder is a place holder for DNS_RCODE + // DNSRCodePlaceholder is a place holder for DNS_RCODE // // Values that could be NOERROR, FORMERR, SERVFAIL, NXDOMAIN, NOTIMP and REFUSED - DNSRCodePlaceHolder = "[DNS_RCODE]" + DNSRCodePlaceholder = "[DNS_RCODE]" // ResponseTimePlaceholder is a placeholder for the request response time, in milliseconds. // @@ -152,7 +152,7 @@ func sanitizeAndResolve(list []string, result *Result) []string { element = strconv.Itoa(int(result.Duration.Milliseconds())) case BodyPlaceholder: element = body - case DNSRCodePlaceHolder: + case DNSRCodePlaceholder: element = result.DNSRCode case ConnectedPlaceholder: element = strconv.FormatBool(result.Connected) diff --git a/core/dns_test.go b/core/dns_test.go index eefc9eaf..a3172d23 100644 --- a/core/dns_test.go +++ b/core/dns_test.go @@ -84,7 +84,7 @@ func TestIntegrationQuery(t *testing.T) { t.Errorf("there should be errors") } if result.DNSRCode != test.expectedDNSCode { - t.Errorf("DNSRCodePlaceHolder '%s' should have been %s", result.DNSRCode, test.expectedDNSCode) + t.Errorf("DNSRCodePlaceholder '%s' should have been %s", result.DNSRCode, test.expectedDNSCode) } if string(result.Body) != test.expectedBody { diff --git a/core/types.go b/core/types.go index 4a7616c5..fabca387 100644 --- a/core/types.go +++ b/core/types.go @@ -19,8 +19,8 @@ type Result struct { // HTTPStatus is the HTTP response status code HTTPStatus int `json:"status"` - // - DNSRCode string `json:"dnsr_code"` + // DNSRCode is the response code of DNS query in human readable version + DNSRCode string `json:"dns-rcode"` // Body is the response body Body []byte `json:"-"`