diff options
author | Bjørn Erik Pedersen <[email protected]> | 2024-05-17 17:06:47 +0200 |
---|---|---|
committer | Bjørn Erik Pedersen <[email protected]> | 2024-06-04 16:07:39 +0200 |
commit | 447108fed2842e264897659856e9fd9cdc32ca23 (patch) | |
tree | 53687693e04496919dd84266cc1edc16746101b0 /common/predicate | |
parent | c71e24af5172e230baa5f7dfa2078721cda38df4 (diff) | |
download | hugo-447108fed2842e264897659856e9fd9cdc32ca23.tar.gz hugo-447108fed2842e264897659856e9fd9cdc32ca23.zip |
Add a HTTP cache for remote resources.
Fixes #12502
Closes #11891
Diffstat (limited to 'common/predicate')
-rw-r--r-- | common/predicate/predicate.go | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/common/predicate/predicate.go b/common/predicate/predicate.go index f9cb1bb2b..f71536474 100644 --- a/common/predicate/predicate.go +++ b/common/predicate/predicate.go @@ -24,6 +24,9 @@ func (p P[T]) And(ps ...P[T]) P[T] { return false } } + if p == nil { + return true + } return p(v) } } @@ -36,6 +39,9 @@ func (p P[T]) Or(ps ...P[T]) P[T] { return true } } + if p == nil { + return false + } return p(v) } } |