if no dns then no resolver nor dig nor nothin
This commit is contained in:
@@ -32,7 +32,7 @@ func NewServer(c *Config) *Server {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
if c.DNS == "" {
|
if c.DNS == "" {
|
||||||
resolver = &net.Resolver{}
|
resolver = nil
|
||||||
}
|
}
|
||||||
transport := &http.Transport{}
|
transport := &http.Transport{}
|
||||||
transport.TLSClientConfig = &tls.Config{
|
transport.TLSClientConfig = &tls.Config{
|
||||||
@@ -133,6 +133,9 @@ func (s *Server) xfer(ctx context.Context, w io.Writer, r io.ReadCloser) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *Server) dig(ctx context.Context, host string) (string, error) {
|
func (s *Server) dig(ctx context.Context, host string) (string, error) {
|
||||||
|
if s.resolver == nil {
|
||||||
|
return host, nil
|
||||||
|
}
|
||||||
search := host
|
search := host
|
||||||
search = strings.TrimPrefix(search, "https://")
|
search = strings.TrimPrefix(search, "https://")
|
||||||
search = strings.TrimPrefix(search, "http://")
|
search = strings.TrimPrefix(search, "http://")
|
||||||
|
|||||||
Reference in New Issue
Block a user