From 1fff629074c908718893337c58d0896e7e1d5a8b Mon Sep 17 00:00:00 2001 From: Gontier Julien Date: Wed, 14 Sep 2022 11:15:23 +0200 Subject: [PATCH] Removing Firefox 61-62 patch Signed-off-by: Gontier Julien --- doh-server/ietf.go | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) diff --git a/doh-server/ietf.go b/doh-server/ietf.go index bb719f4..1d5d93d 100644 --- a/doh-server/ietf.go +++ b/doh-server/ietf.go @@ -182,8 +182,6 @@ func (s *Server) generateResponseIETF(ctx context.Context, w http.ResponseWriter w.Header().Set("Last-Modified", now) w.Header().Set("Vary", "Accept") - _ = s.patchFirefoxContentType(w, r, req) - if respJSON.HaveTTL { if req.isTailored { w.Header().Set("Cache-Control", "private, max-age="+strconv.FormatUint(uint64(respJSON.LeastTTL), 10)) @@ -217,18 +215,4 @@ func (s *Server) patchDNSCryptProxyReqID(w http.ResponseWriter, r *http.Request, return true } return false -} - -// Workaround a bug causing Firefox 61-62 to reject responses with Content-Type = application/dns-message -func (s *Server) patchFirefoxContentType(w http.ResponseWriter, r *http.Request, req *DNSRequest) bool { - if strings.Contains(r.UserAgent(), "Firefox") && strings.Contains(r.Header.Get("Accept"), "application/dns-udpwireformat") && !strings.Contains(r.Header.Get("Accept"), "application/dns-message") { - if s.conf.Verbose { - log.Println("Firefox 61-62 detected. Patching response.") - } - w.Header().Set("Content-Type", "application/dns-udpwireformat") - w.Header().Set("Vary", "Accept, User-Agent") - req.isTailored = true - return true - } - return false -} +} \ No newline at end of file