Skip to content

Commit

Permalink
🎨 Fix no_cache #167
Browse files Browse the repository at this point in the history
2

2
  • Loading branch information
mokeyish committed Oct 3, 2023
1 parent f164a25 commit 7f9289d
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/dns.rs
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,12 @@ pub struct DnsContext {
impl DnsContext {
pub fn new(name: &Name, cfg: Arc<SmartDnsConfig>, server_opts: ServerOpts) -> Self {
let domain_rule = cfg.find_domain_rule(name);

let no_cache = domain_rule
.as_ref()
.and_then(|r| r.no_cache)
.and_then(|r| r.get(|n| n.no_cache))
.unwrap_or_default();

DnsContext {
cfg,
server_opts,
Expand Down

0 comments on commit 7f9289d

Please sign in to comment.