Merge "Expose headers option of apache::vhost"

This commit is contained in:
Zuul 2022-07-30 14:58:41 +00:00 committed by Gerrit Code Review
commit c00d15899b
3 changed files with 24 additions and 1 deletions

View File

@ -87,6 +87,14 @@
# { python-path => '/my/python/virtualenv' }
# Defaults to {}
#
# [*headers*]
# (Optional) Headers for the vhost.
# Defaults to undef
#
# [*request_headers*]
# (Optional) Modifies collected request headers in various ways.
# Defaults to undef
#
# == Example:
#
# include apache
@ -113,6 +121,8 @@ class sahara::wsgi::apache (
$access_log_format = false,
$error_log_file = undef,
$custom_wsgi_process_options = {},
$headers = undef,
$request_headers = undef,
) {
include sahara::deps
@ -144,6 +154,8 @@ class sahara::wsgi::apache (
wsgi_script_dir => $::sahara::params::sahara_wsgi_script_path,
wsgi_script_file => 'app',
wsgi_script_source => $::sahara::params::sahara_wsgi_script_source,
headers => $headers,
request_headers => $request_headers,
access_log_file => $access_log_file,
access_log_format => $access_log_format,
error_log_file => $error_log_file,

View File

@ -0,0 +1,5 @@
---
features:
- |
The ``sahara::wsgi::apache`` class now supports customizing
request/response headers added by apache.

View File

@ -23,13 +23,15 @@ describe 'sahara::wsgi::apache' do
:wsgi_script_dir => platform_params[:wsgi_script_path],
:wsgi_script_file => 'app',
:wsgi_script_source => platform_params[:wsgi_script_source],
:headers => nil,
:request_headers => nil,
:custom_wsgi_process_options => {},
:access_log_file => false,
:access_log_format => false,
)}
end
context 'when overriding paramters using different ports' do
context 'when overriding paramters' do
let :params do
{
:servername => 'dummy.host',
@ -42,6 +44,8 @@ describe 'sahara::wsgi::apache' do
:custom_wsgi_process_options => {
'python_path' => '/my/python/path',
},
:headers => ['set X-XSS-Protection "1; mode=block"'],
:request_headers => ['set Content-Type "application/json"'],
:access_log_file => '/var/log/httpd/access_log',
:access_log_format => 'some format',
:error_log_file => '/var/log/httpd/error_log'
@ -64,6 +68,8 @@ describe 'sahara::wsgi::apache' do
:wsgi_script_dir => platform_params[:wsgi_script_path],
:wsgi_script_file => 'app',
:wsgi_script_source => platform_params[:wsgi_script_source],
:headers => ['set X-XSS-Protection "1; mode=block"'],
:request_headers => ['set Content-Type "application/json"'],
:custom_wsgi_process_options => {
'python_path' => '/my/python/path',
},