chore: format code

This commit is contained in:
Skyxim 2023-03-12 14:58:27 +08:00
parent d0b95e91f5
commit 8ee452f544
4 changed files with 5 additions and 5 deletions

View File

@ -124,4 +124,4 @@ const (
HTTPVersion2 HTTPVersion = "h2" HTTPVersion2 HTTPVersion = "h2"
// HTTPVersion3 is HTTP/3. // HTTPVersion3 is HTTP/3.
HTTPVersion3 HTTPVersion = "h3" HTTPVersion3 HTTPVersion = "h3"
) )

View File

@ -47,7 +47,7 @@ func withHosts(hosts R.Hosts, mapping *cache.LruCache[netip.Addr, string]) middl
if err == nil { if err == nil {
resp.Id = r.Id resp.Id = r.Id
resp.Question = r.Question resp.Question = r.Question
handleCName(resp,record.Domain) handleCName(resp, record.Domain)
} }
return resp, err return resp, err
} }
@ -84,7 +84,7 @@ func withHosts(hosts R.Hosts, mapping *cache.LruCache[netip.Addr, string]) middl
case D.TypeAAAA: case D.TypeAAAA:
handleIPs() handleIPs()
case D.TypeCNAME: case D.TypeCNAME:
handleCName(r,record.Domain) handleCName(r, record.Domain)
default: default:
return next(ctx, r) return next(ctx, r)
} }

View File

@ -66,7 +66,7 @@ func setMsgTTL(msg *D.Msg, ttl uint32) {
} }
func isIPRequest(q D.Question) bool { func isIPRequest(q D.Question) bool {
return q.Qclass == D.ClassINET && (q.Qtype == D.TypeA || q.Qtype == D.TypeAAAA||q.Qtype==D.TypeCNAME) return q.Qclass == D.ClassINET && (q.Qtype == D.TypeA || q.Qtype == D.TypeAAAA || q.Qtype == D.TypeCNAME)
} }
func transform(servers []NameServer, resolver *Resolver) []dnsClient { func transform(servers []NameServer, resolver *Resolver) []dnsClient {

View File

@ -44,7 +44,7 @@ func Parse(options ...Option) error {
if cfg.General.ExternalController != "" { if cfg.General.ExternalController != "" {
go route.Start(cfg.General.ExternalController, cfg.General.ExternalControllerTLS, go route.Start(cfg.General.ExternalController, cfg.General.ExternalControllerTLS,
cfg.General.Secret, cfg.TLS.Certificate, cfg.TLS.PrivateKey,cfg.General.LogLevel==log.DEBUG) cfg.General.Secret, cfg.TLS.Certificate, cfg.TLS.PrivateKey, cfg.General.LogLevel == log.DEBUG)
} }
executor.ApplyConfig(cfg, true) executor.ApplyConfig(cfg, true)