Skip to content

Commit

Permalink
all: safesearch https
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizzick committed Apr 11, 2024
1 parent cd403a2 commit 14e823d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
2 changes: 1 addition & 1 deletion internal/dnsforward/msg.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ func (s *Server) genDNSFilterMessage(
) (resp *dns.Msg) {
req := dctx.Req
qt := req.Question[0].Qtype
if qt != dns.TypeA && qt != dns.TypeAAAA {
if qt != dns.TypeA && qt != dns.TypeAAAA && qt != dns.TypeHTTPS {
m, _, _ := s.dnsFilter.BlockingMode()
if m == filtering.BlockingModeNullIP {
return s.makeResponse(req)
Expand Down
7 changes: 5 additions & 2 deletions internal/filtering/safesearch/safesearch.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,8 +226,8 @@ func (ss *Default) searchHost(host string, qtype rules.RRType) (res *rules.DNSRe
}

// newResult creates Result object from rewrite rule. qtype must be either
// [dns.TypeA] or [dns.TypeAAAA]. If err is nil, res is never nil, so that the
// empty result is converted into a NODATA response.
// [dns.TypeA] or [dns.TypeAAAA], or [dns.TypeHTTPS]. If err is nil, res is
// never nil, so that the empty result is converted into a NODATA response.
//
// TODO(a.garipov): Use the main rewrite result mechanism used in
// [dnsforward.Server.filterDNSRequest]. Now we resolve IPs for CNAME to save
Expand Down Expand Up @@ -261,6 +261,9 @@ func (ss *Default) newResult(
}

res.CanonName = host
if qtype == dns.TypeHTTPS {
return res, nil
}

ss.log(log.DEBUG, "resolving %q", host)

Expand Down

0 comments on commit 14e823d

Please sign in to comment.