diff --git a/manifests/vhost.pp b/manifests/vhost.pp index ad0c312146..3bdaefc81d 100644 --- a/manifests/vhost.pp +++ b/manifests/vhost.pp @@ -1409,7 +1409,7 @@ # docroot => '/path/to/directory', # directories => { # path => '/path/to/directory', -# headers => 'Set X-Robots-Tag "noindex, noarchive, nosnippet"', +# headers => ['Set X-Robots-Tag "noindex, noarchive, nosnippet"'], # }, # } # ``` @@ -1853,7 +1853,7 @@ Optional[Variant[Array[String],String]] $redirectmatch_status = undef, Optional[Variant[Array[String],String]] $redirectmatch_regexp = undef, Optional[Variant[Array[String],String]] $redirectmatch_dest = undef, - Optional[String] $headers = undef, + Optional[Array[String]] $headers = undef, Optional[Array[String]] $request_headers = undef, Optional[Array[String]] $filters = undef, Optional[Array] $rewrites = undef, @@ -2260,7 +2260,7 @@ } # Check if mod_headers is required to process $headers/$request_headers - if $headers or $request_headers { + if ($headers and ! empty ($headers)) or ($request_headers and ! empty($request_headers)) { if ! defined(Class['apache::mod::headers']) { include apache::mod::headers } diff --git a/spec/defines/vhost_spec.rb b/spec/defines/vhost_spec.rb index f79fb4065e..e45a0644d2 100644 --- a/spec/defines/vhost_spec.rb +++ b/spec/defines/vhost_spec.rb @@ -385,7 +385,7 @@ 'redirectmatch_status' => ['404'], 'redirectmatch_regexp' => ['\.git$'], 'redirectmatch_dest' => ['http://www.example.com'], - 'headers' => 'Set X-Robots-Tag "noindex, noarchive, nosnippet"', + 'headers' => ['Set X-Robots-Tag "noindex, noarchive, nosnippet"', 'Accept: text/html'], 'request_headers' => ['append MirrorID "mirror 12"'], 'rewrites' => [ {