Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable setting LimitRequestFieldSize globally as it does not actually… #1293

Merged
merged 2 commits into from
Dec 15, 2015
Merged
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
5 changes: 1 addition & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@
[`KeepAliveTimeout`]: http://httpd.apache.org/docs/current/mod/core.html#keepalivetimeout
[`keepalive` parameter]: #keepalive
[`keepalive_timeout`]: #keepalive_timeout
[`limitreqfieldsize`]: https://httpd.apache.org/docs/current/mod/core.html#limitrequestfieldsize

[`lib`]: #lib
[`lib_path`]: #lib_path
Expand Down Expand Up @@ -2103,10 +2104,6 @@ Specifies the service name that will be used by Apache for authentication. Corre

This option enables credential saving functionality. Default is 'off'

##### `limit_request_field_size`

[Limits](http://httpd.apache.org/docs/2.4/mod/core.html#limitrequestfieldsize) the size of the HTTP request header allowed from the client. Default is 'undef'.

##### `logroot`

Specifies the location of the virtual host's logfiles. Defaults to '/var/log/<apache log location>/'.
Expand Down
1 change: 1 addition & 0 deletions manifests/init.pp
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
$keepalive = $::apache::params::keepalive,
$keepalive_timeout = $::apache::params::keepalive_timeout,
$max_keepalive_requests = $::apache::params::max_keepalive_requests,
$limitreqfieldsize = '8190',
$logroot = $::apache::params::logroot,
$logroot_mode = $::apache::params::logroot_mode,
$log_level = $::apache::params::log_level,
Expand Down
14 changes: 0 additions & 14 deletions manifests/vhost.pp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@
$krb_verify_kdc = 'on',
$krb_servicename = 'HTTP',
$krb_save_credentials = 'off',
$limit_request_field_size = undef,
) {
# The base class must be included first because it is used by parameter defaults
if ! defined(Class['apache']) {
Expand Down Expand Up @@ -229,10 +228,6 @@

validate_bool($auth_kerb)

if $limit_request_field_size {
validate_integer($limit_request_field_size)
}

# Validate the docroot as a string if:
# - $manage_docroot is true
if $manage_docroot {
Expand Down Expand Up @@ -984,15 +979,6 @@
content => template('apache/vhost/_filters.erb'),
}
}
# Template uses:
# - $limit_request_field_size
if $limit_request_field_size {
concat::fragment { "${name}-limits":
target => "${priority_real}${filename}.conf",
order => 330,
content => template('apache/vhost/_limits.erb'),
}
}

# Template uses no variables
concat::fragment { "${name}-file_footer":
Expand Down
14 changes: 14 additions & 0 deletions spec/acceptance/apache_parameters_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,20 @@ class { 'apache':
end
end

describe 'limitrequestfieldsize' do
describe 'setup' do
it 'applies cleanly' do
pp = "class { 'apache': limitreqfieldsize => '16830' }"
apply_manifest(pp, :catch_failures => true)
end
end

describe file($conf_file) do
it { is_expected.to be_file }
it { is_expected.to contain 'LimitRequestFieldSize 16830' }
end
end

describe 'logging' do
describe 'setup' do
it 'applies cleanly' do
Expand Down
5 changes: 1 addition & 4 deletions spec/defines/vhost_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -326,8 +326,7 @@
'krb_authoritative' => 'off',
'krb_auth_realms' => ['EXAMPLE.ORG','EXAMPLE.NET'],
'krb_5keytab' => '/tmp/keytab5',
'krb_local_user_mapping' => 'off',
'limit_request_field_size' => '54321',
'krb_local_user_mapping' => 'off'
}
end
let :facts do
Expand Down Expand Up @@ -472,8 +471,6 @@
:content => /^\s+KrbSaveCredentials\soff$/)}
it { is_expected.to contain_concat__fragment('rspec.example.com-auth_kerb').with(
:content => /^\s+KrbVerifyKDC\son$/)}
it { is_expected.to contain_concat__fragment('rspec.example.com-limits').with(
:content => /^\s+LimitRequestFieldSize\s54321$/)}
end
context 'vhost with multiple ip addresses' do
let :params do
Expand Down
1 change: 1 addition & 0 deletions templates/httpd.conf.erb
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ Timeout <%= @timeout %>
KeepAlive <%= @keepalive %>
MaxKeepAliveRequests <%= @max_keepalive_requests %>
KeepAliveTimeout <%= @keepalive_timeout %>
LimitRequestFieldSize <%= @limitreqfieldsize %>

<%- if @rewrite_lock and scope.function_versioncmp([@apache_version, '2.2']) <= 0 -%>
RewriteLock <%= @rewrite_lock %>
Expand Down
5 changes: 0 additions & 5 deletions templates/vhost/_limits.erb

This file was deleted.