Skip to content

Commit 54d08fa

Browse files
committed
Add tests for CRS allowed HTTP methods per vhost
1 parent c582f70 commit 54d08fa

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed

spec/defines/vhost_spec.rb

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1229,6 +1229,29 @@
12291229
}
12301230
end
12311231

1232+
context 'modsec_allowed_methods' do
1233+
let :params do
1234+
{
1235+
'docroot' => '/rspec/docroot',
1236+
'modsec_allowed_methods' => 'GET HEAD POST OPTIONS',
1237+
}
1238+
end
1239+
1240+
it { is_expected.to compile }
1241+
it {
1242+
is_expected.to contain_concat__fragment('rspec.example.com-security').with(
1243+
content: %r{
1244+
^\s+SecAction\ \\\n
1245+
\s+\"id:900200,\\\n
1246+
\s+phase:1,\\\n
1247+
\s+nolog,\\\n\s+pass,\\\n
1248+
\s+t:none,\\\n
1249+
\s+setvar:'tx.allowed_methods=GET\ HEAD\ POST\ OPTIONS'"$
1250+
}x,
1251+
)
1252+
}
1253+
end
1254+
12321255
context 'set only aliases' do
12331256
let :params do
12341257
{

0 commit comments

Comments
 (0)