Update User-Agent

This commit is contained in:
Star Brilliant
2018-04-16 21:35:33 +08:00
parent 627e2d639d
commit ff0e9529cb
4 changed files with 5 additions and 5 deletions
+1 -1
View File
@@ -1,7 +1,7 @@
.PHONY: all clean install uninstall deps .PHONY: all clean install uninstall deps
GOBUILD=go build GOBUILD=go build
GOGET=go get -d -v GOGET=go get -d -u -v
PREFIX=/usr/local PREFIX=/usr/local
ifeq ($(shell uname),Darwin) ifeq ($(shell uname),Darwin)
CONFDIR=/usr/local/etc/dns-over-https CONFDIR=/usr/local/etc/dns-over-https
+1 -1
View File
@@ -92,7 +92,7 @@ func (c *Client) generateRequestGoogle(w dns.ResponseWriter, r *dns.Msg, isTCP b
} }
} }
req.Header.Set("Accept", "application/json, application/dns-message, application/dns-udpwireformat") req.Header.Set("Accept", "application/json, application/dns-message, application/dns-udpwireformat")
req.Header.Set("User-Agent", "DNS-over-HTTPS/1.1 (+https://github.com/m13253/dns-over-https)") req.Header.Set("User-Agent", jsonDNS.USER_AGENT)
c.httpClientMux.RLock() c.httpClientMux.RLock()
resp, err := c.httpClient.Do(req) resp, err := c.httpClient.Do(req)
c.httpClientMux.RUnlock() c.httpClientMux.RUnlock()
+1 -1
View File
@@ -154,7 +154,7 @@ func (c *Client) generateRequestIETF(w dns.ResponseWriter, r *dns.Msg, isTCP boo
req.Header.Set("Content-Type", "application/dns-message") req.Header.Set("Content-Type", "application/dns-message")
} }
req.Header.Set("Accept", "application/dns-message, application/dns-udpwireformat, application/json") req.Header.Set("Accept", "application/dns-message, application/dns-udpwireformat, application/json")
req.Header.Set("User-Agent", "DNS-over-HTTPS/1.1 (+https://github.com/m13253/dns-over-https)") req.Header.Set("User-Agent", jsonDNS.USER_AGENT)
c.httpClientMux.RLock() c.httpClientMux.RLock()
resp, err := c.httpClient.Do(req) resp, err := c.httpClient.Do(req)
c.httpClientMux.RUnlock() c.httpClientMux.RUnlock()
+2 -2
View File
@@ -102,8 +102,8 @@ func (s *Server) Start() error {
} }
func (s *Server) handlerFunc(w http.ResponseWriter, r *http.Request) { func (s *Server) handlerFunc(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Server", "DNS-over-HTTPS/1.1 (+https://github.com/m13253/dns-over-https)") w.Header().Set("Server", jsonDNS.USER_AGENT)
w.Header().Set("X-Powered-By", "DNS-over-HTTPS/1.1 (+https://github.com/m13253/dns-over-https)") w.Header().Set("X-Powered-By", jsonDNS.USER_AGENT)
if r.Form == nil { if r.Form == nil {
const maxMemory = 32 << 20 // 32 MB const maxMemory = 32 << 20 // 32 MB