mirror of
https://github.com/m13253/dns-over-https.git
synced 2026-03-30 12:05:38 +00:00
Update User-Agent
This commit is contained in:
2
Makefile
2
Makefile
@@ -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
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user