Make domain_resolver optional when only one DNS server is configured
This commit is contained in:
@@ -116,7 +116,14 @@ func (o *DomainResolveOptions) UnmarshalJSON(bytes []byte) error {
|
||||
o.Server = stringValue
|
||||
return nil
|
||||
}
|
||||
return json.Unmarshal(bytes, (*_DomainResolveOptions)(o))
|
||||
err = json.Unmarshal(bytes, (*_DomainResolveOptions)(o))
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
if o.Server == "" {
|
||||
return E.New("empty domain_resolver.server")
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
func (o *DialerOptions) TakeDialerOptions() DialerOptions {
|
||||
|
||||
Reference in New Issue
Block a user