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

View File

@@ -1,7 +1,7 @@
.PHONY: all clean install uninstall deps
GOBUILD=go build
GOGET=go get -d -v
GOGET=go get -d -u -v
PREFIX=/usr/local
ifeq ($(shell uname),Darwin)
CONFDIR=/usr/local/etc/dns-over-https

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("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()
resp, err := c.httpClient.Do(req)
c.httpClientMux.RUnlock()

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("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()
resp, err := c.httpClient.Do(req)
c.httpClientMux.RUnlock()

View File

@@ -102,8 +102,8 @@ func (s *Server) Start() error {
}
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("X-Powered-By", "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", jsonDNS.USER_AGENT)
if r.Form == nil {
const maxMemory = 32 << 20 // 32 MB