fix(scripts): Fix the output and recording of data

This commit is contained in:
2026-04-06 21:26:02 +01:00
parent cd8a6c5433
commit 464ee6fd1a
6 changed files with 47 additions and 43 deletions
+3 -3
View File
@@ -43,7 +43,7 @@ func New(config Config) (*Client, error) {
}
logger.Debug("Creating DoH client: %s:%s%s (KeepAlive: %v)", config.Host, config.Port, config.Path, config.KeepAlive)
if config.Host == "" || config.Port == "" || config.Path == "" {
logger.Error("DoH client creation failed: missing required fields")
return nil, errors.New("doh: host, port, and path must not be empty")
@@ -136,7 +136,7 @@ func (c *Client) Query(msg *dns.Msg) (*dns.Msg, error) {
if c.config.DNSSEC {
msg.SetEdns0(4096, true)
}
packedMsg, err := msg.Pack()
if err != nil {
logger.Error("DoH failed to pack DNS message: %v", err)
@@ -152,7 +152,7 @@ func (c *Client) Query(msg *dns.Msg) (*dns.Msg, error) {
httpReq.Header.Set("User-Agent", "sdns-proxy")
httpReq.Header.Set("Content-Type", dnsMessageContentType)
httpReq.Header.Set("Accept", dnsMessageContentType)
// Set Connection header based on KeepAlive setting
if c.config.KeepAlive {
httpReq.Header.Set("Connection", "keep-alive")