new proxy_cache_valid parameter validation

This commit is contained in:
Herwig Bogaert 2016-04-12 10:02:08 +02:00
parent 40d157482e
commit e62342e779
2 changed files with 6 additions and 2 deletions

View file

@ -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)

View file

@ -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)