File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -50,6 +50,9 @@ function store_methods:store(host, directives)
5050 max_age = tonumber (max_age , 10 )
5151 end
5252
53+ -- Clean now so that we can assume there are no expired items in store
54+ self :clean ()
55+
5356 if max_age == 0 then
5457 return self :remove (host )
5558 else
@@ -86,14 +89,15 @@ function store_methods:check(host)
8689 if http_util .is_ip (host ) then
8790 return false
8891 end
89- local now = self .time ()
92+
93+ -- Clean now so that we can assume there are no expired items in store
94+ self :clean ()
95+
9096 local h = host
9197 repeat
9298 local item = self .domains [h ]
9399 if item then
94- if item .expires < now then
95- self :clean ()
96- elseif host == h or item .includeSubdomains then
100+ if host == h or item .includeSubdomains then
97101 return true
98102 end
99103 end
You can’t perform that action at this time.
0 commit comments