mirror of
https://github.com/coredns/coredns.git
synced 2025-10-28 08:44:17 -04:00
middleware/cache: cache 0 will be capped at 5 (#408)
* middleware/cache: cache 0 will be capped at 5 cache 0 would return TTL=0 records, up that to the documented minimum of 5 seconds. * middleware/cache: check for 0 TTL Handle 0 TTL differently and return an error, we might need to special case this in the future.
This commit is contained in:
5
middleware/cache/setup_test.go
vendored
5
middleware/cache/setup_test.go
vendored
@@ -44,6 +44,11 @@ func TestSetup(t *testing.T) {
|
||||
positive 15
|
||||
negative aaa
|
||||
}`, true, defaultCap, defaultCap, maxTTL, maxTTL},
|
||||
{`cache 0 example.nl`, true, defaultCap, defaultCap, maxTTL, maxTTL},
|
||||
{`cache -1 example.nl`, true, defaultCap, defaultCap, maxTTL, maxTTL},
|
||||
{`cache 1 example.nl {
|
||||
positive 0
|
||||
}`, true, defaultCap, defaultCap, maxTTL, maxTTL},
|
||||
}
|
||||
for i, test := range tests {
|
||||
c := caddy.NewTestController("dns", test.input)
|
||||
|
||||
Reference in New Issue
Block a user