From e62342e779f805e19aa8c858acd1363bbd30ebea Mon Sep 17 00:00:00 2001 From: Herwig Bogaert Date: Tue, 12 Apr 2016 10:02:08 +0200 Subject: [PATCH] new proxy_cache_valid parameter validation --- manifests/resource/location.pp | 4 +++- manifests/resource/vhost.pp | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/manifests/resource/location.pp b/manifests/resource/location.pp index aea8119..66c1e65 100644 --- a/manifests/resource/location.pp +++ b/manifests/resource/location.pp @@ -296,7 +296,9 @@ define nginx::resource::location ( validate_string($proxy_cache_use_stale) } if ($proxy_cache_valid != false) { - validate_slength(any2array($proxy_cache_valid),12,1) + if !(is_array($proxy_cache_valid) or is_string($proxy_cache_valid)) { + fail('$proxy_cache_valid must be a string or an array or false.') + } } if ($proxy_method != undef) { validate_string($proxy_method) diff --git a/manifests/resource/vhost.pp b/manifests/resource/vhost.pp index af4e700..80c9646 100644 --- a/manifests/resource/vhost.pp +++ b/manifests/resource/vhost.pp @@ -372,7 +372,9 @@ define nginx::resource::vhost ( validate_string($proxy_cache_use_stale) } if ($proxy_cache_valid != false) { - validate_slength(any2array($proxy_cache_valid),12,1) + if !(is_array($proxy_cache_valid) or is_string($proxy_cache_valid)) { + fail('$proxy_cache_valid must be a string or an array or false.') + } } if ($proxy_method != undef) { validate_string($proxy_method)