Expose headers option of apache::vhost
The headers option in apache::vhost is required in some case, for example when adding the X-XSS-Protection header. This change allows customizing the option for the api vhost. This change also adds support for request_headers so that both request headers and response headers can customized. Change-Id: I8fd01cee29c1d906e3f427a15b5f0b23a8f29049
This commit is contained in:
parent
e6a1626391
commit
32084a9272
@ -89,6 +89,14 @@
|
|||||||
# { python-path => '/my/python/virtualenv' }
|
# { python-path => '/my/python/virtualenv' }
|
||||||
# Defaults to {}
|
# Defaults to {}
|
||||||
#
|
#
|
||||||
|
# [*headers*]
|
||||||
|
# (optional) Headers for the vhost.
|
||||||
|
# Defaults to undef
|
||||||
|
#
|
||||||
|
# [*request_headers*]
|
||||||
|
# (optional) Modifies collected request headers in various ways.
|
||||||
|
# Defaults to undef
|
||||||
|
#
|
||||||
# [*vhost_custom_fragment*]
|
# [*vhost_custom_fragment*]
|
||||||
# (optional) Passes a string of custom configuration
|
# (optional) Passes a string of custom configuration
|
||||||
# directives to be placed at the end of the vhost configuration.
|
# directives to be placed at the end of the vhost configuration.
|
||||||
@ -126,6 +134,8 @@ class manila::wsgi::apache (
|
|||||||
$access_log_format = false,
|
$access_log_format = false,
|
||||||
$error_log_file = undef,
|
$error_log_file = undef,
|
||||||
$custom_wsgi_process_options = {},
|
$custom_wsgi_process_options = {},
|
||||||
|
$headers = undef,
|
||||||
|
$request_headers = undef,
|
||||||
$vhost_custom_fragment = undef,
|
$vhost_custom_fragment = undef,
|
||||||
) {
|
) {
|
||||||
|
|
||||||
@ -159,6 +169,8 @@ class manila::wsgi::apache (
|
|||||||
wsgi_script_dir => $::manila::params::manila_wsgi_script_path,
|
wsgi_script_dir => $::manila::params::manila_wsgi_script_path,
|
||||||
wsgi_script_file => 'manila-api',
|
wsgi_script_file => 'manila-api',
|
||||||
wsgi_script_source => $::manila::params::manila_wsgi_script_source,
|
wsgi_script_source => $::manila::params::manila_wsgi_script_source,
|
||||||
|
headers => $headers,
|
||||||
|
request_headers => $request_headers,
|
||||||
custom_wsgi_process_options => $custom_wsgi_process_options,
|
custom_wsgi_process_options => $custom_wsgi_process_options,
|
||||||
access_log_file => $access_log_file,
|
access_log_file => $access_log_file,
|
||||||
access_log_format => $access_log_format,
|
access_log_format => $access_log_format,
|
||||||
|
5
releasenotes/notes/apache-headers-a2f35e9fae4c7667.yaml
Normal file
5
releasenotes/notes/apache-headers-a2f35e9fae4c7667.yaml
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
---
|
||||||
|
features:
|
||||||
|
- |
|
||||||
|
The ``manila::wsgi::apache`` class now supports customizing
|
||||||
|
request/response headers added by apache.
|
@ -19,13 +19,15 @@ describe 'manila::wsgi::apache' do
|
|||||||
:wsgi_script_dir => platform_params[:wsgi_script_path],
|
:wsgi_script_dir => platform_params[:wsgi_script_path],
|
||||||
:wsgi_script_file => 'manila-api',
|
:wsgi_script_file => 'manila-api',
|
||||||
:wsgi_script_source => platform_params[:wsgi_script_source],
|
:wsgi_script_source => platform_params[:wsgi_script_source],
|
||||||
|
:headers => nil,
|
||||||
|
:request_headers => nil,
|
||||||
:custom_wsgi_process_options => {},
|
:custom_wsgi_process_options => {},
|
||||||
:access_log_file => false,
|
:access_log_file => false,
|
||||||
:access_log_format => false,
|
:access_log_format => false,
|
||||||
)}
|
)}
|
||||||
end
|
end
|
||||||
|
|
||||||
context 'when overriding parameters using different ports' do
|
context 'when overriding parameters' do
|
||||||
let :params do
|
let :params do
|
||||||
{
|
{
|
||||||
:servername => 'dummy.host',
|
:servername => 'dummy.host',
|
||||||
@ -40,6 +42,8 @@ describe 'manila::wsgi::apache' do
|
|||||||
:access_log_file => '/var/log/httpd/access_log',
|
:access_log_file => '/var/log/httpd/access_log',
|
||||||
:access_log_format => 'some format',
|
:access_log_format => 'some format',
|
||||||
:error_log_file => '/var/log/httpd/error_log',
|
:error_log_file => '/var/log/httpd/error_log',
|
||||||
|
:headers => ['set X-XSS-Protection "1; mode=block"'],
|
||||||
|
:request_headers => ['set Content-Type "application/json"'],
|
||||||
:vhost_custom_fragment => 'Timeout 99'
|
:vhost_custom_fragment => 'Timeout 99'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
@ -61,6 +65,8 @@ describe 'manila::wsgi::apache' do
|
|||||||
:wsgi_script_dir => platform_params[:wsgi_script_path],
|
:wsgi_script_dir => platform_params[:wsgi_script_path],
|
||||||
:wsgi_script_file => 'manila-api',
|
:wsgi_script_file => 'manila-api',
|
||||||
:wsgi_script_source => platform_params[:wsgi_script_source],
|
: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 => {
|
:custom_wsgi_process_options => {
|
||||||
'python_path' => '/my/python/admin/path',
|
'python_path' => '/my/python/admin/path',
|
||||||
},
|
},
|
||||||
|
Loading…
x
Reference in New Issue
Block a user