mirror of
https://github.com/DNSCrypt/dnscrypt-proxy.git
synced 2025-03-03 18:04:40 +01:00
Nits
This commit is contained in:
parent
3f3cd1e67d
commit
45a4df8df5
3 changed files with 5 additions and 7 deletions
|
@ -170,7 +170,7 @@ func ColdStart(proxy *Proxy) (*CaptivePortalHandler, error) {
|
|||
if err != nil {
|
||||
continue
|
||||
}
|
||||
if strings.Index(ipsStr, "*") != -1 {
|
||||
if strings.Contains(ipsStr, "*") {
|
||||
return nil, fmt.Errorf(
|
||||
"A captive portal rule must use an exact host name at line %d",
|
||||
1+lineNo,
|
||||
|
|
|
@ -60,10 +60,8 @@ func (plugin *PluginForward) Init(proxy *Proxy) error {
|
|||
continue
|
||||
}
|
||||
domain, serversStr, ok := StringTwoFields(line)
|
||||
if strings.HasPrefix(domain, "*.") {
|
||||
domain = domain[2:]
|
||||
}
|
||||
if strings.Index(domain, "*") != -1 {
|
||||
domain = strings.TrimPrefix(domain, "*.")
|
||||
if strings.Contains(domain, "*") {
|
||||
ok = false
|
||||
}
|
||||
if !ok {
|
||||
|
@ -205,7 +203,7 @@ func (plugin *PluginForward) Eval(pluginsState *PluginsState, msg *dns.Msg) erro
|
|||
dlog.Infof("No response from the DHCP server while resolving [%s]", qName)
|
||||
continue
|
||||
}
|
||||
if dhcpDNS != nil && len(dhcpDNS) > 0 {
|
||||
if len(dhcpDNS) > 0 {
|
||||
server = net.JoinHostPort(dhcpDNS[rand.Intn(len(dhcpDNS))].String(), "53")
|
||||
break
|
||||
}
|
||||
|
|
|
@ -234,7 +234,7 @@ func (xTransport *XTransport) rebuildTransport() {
|
|||
tlsClientConfig.Certificates = []tls.Certificate{cert}
|
||||
}
|
||||
|
||||
overrideCipherSuite := xTransport.tlsCipherSuite != nil && len(xTransport.tlsCipherSuite) > 0
|
||||
overrideCipherSuite := len(xTransport.tlsCipherSuite) > 0
|
||||
if xTransport.tlsDisableSessionTickets || overrideCipherSuite {
|
||||
tlsClientConfig.SessionTicketsDisabled = xTransport.tlsDisableSessionTickets
|
||||
if !xTransport.tlsDisableSessionTickets {
|
||||
|
|
Loading…
Add table
Reference in a new issue