From ce13a961db12bccaea597e45d66df2d4a8447abd Mon Sep 17 00:00:00 2001 From: Star Brilliant Date: Wed, 11 Sep 2019 02:08:02 +0800 Subject: [PATCH] Fix build error --- Makefile | 1 + doh-client/google.go | 2 +- doh-client/ietf.go | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 9a988bc..a122f7d 100644 --- a/Makefile +++ b/Makefile @@ -59,6 +59,7 @@ uninstall: deps: @# I am not sure if it is the correct way to keep the common library updated + $(GOGET_UPDATE) github.com/m13253/dns-over-https/doh-client/config $(GOGET_UPDATE) github.com/m13253/dns-over-https/json-dns $(GOGET) ./doh-client ./doh-server diff --git a/doh-client/google.go b/doh-client/google.go index b690062..0e4bc9d 100644 --- a/doh-client/google.go +++ b/doh-client/google.go @@ -86,7 +86,7 @@ func (c *Client) generateRequestGoogle(ctx context.Context, w dns.ResponseWriter } req.Header.Set("Accept", "application/json, application/dns-message, application/dns-udpwireformat") - if !c.conf.NoUserAgent { + if !c.conf.Other.NoUserAgent { req.Header.Set("User-Agent", USER_AGENT) } else { req.Header.Set("User-Agent", "") diff --git a/doh-client/ietf.go b/doh-client/ietf.go index 7cdcb28..421a8e4 100644 --- a/doh-client/ietf.go +++ b/doh-client/ietf.go @@ -128,7 +128,7 @@ func (c *Client) generateRequestIETF(ctx context.Context, w dns.ResponseWriter, req.Header.Set("Content-Type", "application/dns-message") } req.Header.Set("Accept", "application/dns-message, application/dns-udpwireformat, application/json") - if !c.conf.NoUserAgent { + if !c.conf.Other.NoUserAgent { req.Header.Set("User-Agent", USER_AGENT) } else { req.Header.Set("User-Agent", "")