Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@
# default setting omits the declaration from the server configuration and selects the
# Apache default setting of `Off`.
#
# @param file_e_tag
# Sets the server default for the `FileETag` declaration, which modifies the response header
# field for static files.
#
# @param block
# Specifies the list of things to which Apache blocks access. Valid options are: `scm` (which
# blocks web access to `.svn`), `.git`, and `.bzr` directories.
Expand Down Expand Up @@ -1861,6 +1865,7 @@
Variant[Array[String], String] $additional_includes = [],
Boolean $use_optional_includes = $apache::use_optional_includes,
Optional[Variant[Apache::OnOff, Enum['nodecode']]] $allow_encoded_slashes = undef,
Optional[String] $file_e_tag = undef,
Optional[Pattern[/^[\w-]+ [\w-]+$/]] $suexec_user_group = undef,

Optional[Boolean] $h2_copy_files = undef,
Expand Down Expand Up @@ -2977,6 +2982,17 @@
}
}

if $file_e_tag {
$file_e_tag_params = {
'file_e_tag' => $file_e_tag,
}
concat::fragment { "${name}-file_e_tag":
target => "${priority_real}${filename}.conf",
order => 410,
content => epp('apache/vhost/_file_e_tag.epp', $file_e_tag_params),
}
}

$file_footer_params = {
'define' => $define,
'passenger_pre_start' => $passenger_pre_start,
Expand Down
19 changes: 19 additions & 0 deletions spec/acceptance/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1306,4 +1306,23 @@ class { 'apache': }
it { is_expected.to contain 'OIDCCryptoPassphrase 4ad1bb46-9979-450e-ae58-c696967df3cd' }
end
end

describe 'file_e_tag' do
pp = <<-MANIFEST
class { 'apache': }
apache::vhost { 'test.server':
port => 80,
docroot => '/var/www/html',
file_e_tag => 'None',
}
MANIFEST
it 'applies cleanly' do
apply_manifest(pp, catch_failures: true)
end

describe file("#{apache_hash['vhost_dir']}/25-test.server.conf") do
it { is_expected.to be_file }
it { is_expected.to contain 'FileETag None' }
end
end
end
3 changes: 3 additions & 0 deletions templates/vhost/_directories.erb
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,9 @@
</FilesMatch>
<%- end -%>
<%- end -%>
<%- unless directory['file_e_tag'].nil? -%>
FileETag <%= directory['file_e_tag'] %>
<%- end -%>
<%- if directory['sethandler'] and directory['sethandler'] != '' -%>
SetHandler <%= directory['sethandler'] %>
<%- end -%>
Expand Down
4 changes: 4 additions & 0 deletions templates/vhost/_file_e_tag.epp
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<%- if $file_e_tag { -%>

FileETag <%= $file_e_tag %>
<%- } -%>
Loading