File tree Expand file tree Collapse file tree 4 files changed +42
-0
lines changed Expand file tree Collapse file tree 4 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 106106# default setting omits the declaration from the server configuration and selects the
107107# Apache default setting of `Off`.
108108#
109+ # @param file_e_tag
110+ # Sets the server default for the `FileETag` declaration, which modifies the response header
111+ # field for static files.
112+ #
109113# @param block
110114# Specifies the list of things to which Apache blocks access. Valid options are: `scm` (which
111115# blocks web access to `.svn`), `.git`, and `.bzr` directories.
18611865 Variant[Array[String], String] $additional_includes = [],
18621866 Boolean $use_optional_includes = $apache::use_optional_includes ,
18631867 Optional[Variant[Apache::OnOff, Enum[' nodecode' ]]] $allow_encoded_slashes = undef ,
1868+ Optional[String] $file_e_tag = undef ,
18641869 Optional[Pattern[/^[\w-]+ [\w-]+$/]] $suexec_user_group = undef ,
18651870
18661871 Optional[Boolean] $h2_copy_files = undef ,
29772982 }
29782983 }
29792984
2985+ if $file_e_tag {
2986+ $file_e_tag_params = {
2987+ ' file_e_tag' => $file_e_tag ,
2988+ }
2989+ concat::fragment { "${name}-file_e_tag" :
2990+ target => " ${priority_real}${filename} .conf" ,
2991+ order => 410,
2992+ content => epp(' apache/vhost/_file_e_tag.epp' , $file_e_tag_params ),
2993+ }
2994+ }
2995+
29802996 $file_footer_params = {
29812997 ' define' => $define ,
29822998 ' passenger_pre_start' => $passenger_pre_start ,
Original file line number Diff line number Diff line change @@ -1306,4 +1306,23 @@ class { 'apache': }
13061306 it { is_expected . to contain 'OIDCCryptoPassphrase 4ad1bb46-9979-450e-ae58-c696967df3cd' }
13071307 end
13081308 end
1309+
1310+ describe 'file_e_tag' do
1311+ pp = <<-MANIFEST
1312+ class { 'apache': }
1313+ apache::vhost { 'test.server':
1314+ port => 80,
1315+ docroot => '/var/www/html',
1316+ file_e_tag => 'None',
1317+ }
1318+ MANIFEST
1319+ it 'applies cleanly' do
1320+ apply_manifest ( pp , catch_failures : true )
1321+ end
1322+
1323+ describe file ( "#{ apache_hash [ 'vhost_dir' ] } /25-test.server.conf" ) do
1324+ it { is_expected . to be_file }
1325+ it { is_expected . to contain 'FileETag None' }
1326+ end
1327+ end
13091328end
Original file line number Diff line number Diff line change 7777 </ FilesMatch >
7878 <%- end -%>
7979 <%- end -%>
80+ <%- unless directory [ 'file_e_tag' ] . nil? -%>
81+ FileETag <%= directory [ 'file_e_tag' ] %>
82+ <%- end -%>
8083 <%- if directory [ 'sethandler' ] and directory [ 'sethandler' ] != '' -%>
8184 SetHandler <%= directory [ 'sethandler' ] %>
8285 <%- end -%>
Original file line number Diff line number Diff line change 1+ <%- if $file_e_tag { -%>
2+
3+ FileETag <%= $file_e_tag %>
4+ <%- } -%>
You can’t perform that action at this time.
0 commit comments