Skip to content

Commit 255b005

Browse files
authored
Merge pull request #2345 from stefan-ahrefs/main
add LimitRequestLine parameter
2 parents 9aabe24 + 1eb13d2 commit 255b005

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

manifests/init.pp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -428,6 +428,9 @@
428428
# The `limitreqfieldsize` parameter sets the maximum ammount of _bytes_ that will
429429
# be allowed within a request header.
430430
#
431+
# @param limitreqline
432+
# The 'limitreqline' parameter sets the limit on the allowed size of a client's HTTP request-line
433+
#
431434
# @param ip
432435
# Specifies the ip address
433436
#
@@ -526,6 +529,7 @@
526529
Integer $max_keepalive_requests = $apache::params::max_keepalive_requests,
527530
Integer $limitreqfieldsize = 8190,
528531
Integer $limitreqfields = 100,
532+
Optional[Integer] $limitreqline = undef,
529533
Stdlib::Absolutepath $logroot = $apache::params::logroot,
530534
Optional[Stdlib::Filemode] $logroot_mode = $apache::params::logroot_mode,
531535
Apache::LogLevel $log_level = $apache::params::log_level,

spec/acceptance/apache_parameters_spec.rb

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,22 @@ class { 'apache':
562562
end
563563
end
564564

565+
describe 'limitreqline' do
566+
pp = <<-MANIFEST
567+
class { 'apache':
568+
limitreqline => 8190,
569+
}
570+
MANIFEST
571+
it 'applys cleanly' do
572+
apply_manifest(pp, catch_failures: true)
573+
end
574+
575+
describe file(apache_hash['conf_file']) do
576+
it { is_expected.to be_file }
577+
it { is_expected.to contain 'LimitRequestLine 8190' }
578+
end
579+
end
580+
565581
describe 'file_e_tag' do
566582
pp = <<-MANIFEST
567583
class { 'apache':

templates/httpd.conf.erb

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ MaxKeepAliveRequests <%= @max_keepalive_requests %>
1515
KeepAliveTimeout <%= @keepalive_timeout %>
1616
LimitRequestFieldSize <%= @limitreqfieldsize %>
1717
LimitRequestFields <%= @limitreqfields %>
18+
<% if @limitreqline -%>
19+
LimitRequestLine <%= @limitreqline %>
20+
<% end -%>
1821
<%# Actually >= 2.4.24, but the minor version is not provided -%>
1922
<%- if @http_protocol_options and scope.function_versioncmp([@apache_version, '2.4']) >= 0 -%>
2023
HttpProtocolOptions <%= @http_protocol_options %>

0 commit comments

Comments
 (0)