Manage oslo_middleware/max_request_body_size
So that we can increase it from the default 114688 Useful in case for example the OS-Federation mapping is too large. If this limit is breached gnocchi will return a 413 Entity Too Large and not log anything to gnocchi.log. Change-Id: Icef45885a9089360bfb7cd414581c4b04809e4f7 Closes-Bug: #1835161
This commit is contained in:
parent
16ba2f71ae
commit
9ae01ae5ee
|
@ -42,6 +42,10 @@
|
|||
# HTTPProxyToWSGI middleware.
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*max_request_body_size*]
|
||||
# (Optional) Set max request body size
|
||||
# Defaults to $::os_service_default.
|
||||
#
|
||||
# [*middlewares*]
|
||||
# (optional) Middlewares to use.
|
||||
# Defaults to $::os_service_default
|
||||
|
@ -55,6 +59,7 @@ class gnocchi::api (
|
|||
$sync_db = false,
|
||||
$auth_strategy = 'keystone',
|
||||
$enable_proxy_headers_parsing = $::os_service_default,
|
||||
$max_request_body_size = $::os_service_default,
|
||||
$middlewares = $::os_service_default,
|
||||
) inherits gnocchi::params {
|
||||
|
||||
|
@ -114,6 +119,7 @@ standalone service, or httpd for being run by a httpd server")
|
|||
|
||||
oslo::middleware { 'gnocchi_config':
|
||||
enable_proxy_headers_parsing => $enable_proxy_headers_parsing,
|
||||
max_request_body_size => $max_request_body_size,
|
||||
}
|
||||
|
||||
if $auth_strategy == 'keystone' {
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
features:
|
||||
- |
|
||||
Add support to configure `[oslo_middleware]/max_request_body_size` with
|
||||
`$max_request_body_size`.
|
|
@ -63,6 +63,7 @@ describe 'gnocchi::api' do
|
|||
is_expected.to contain_gnocchi_config('api/middlewares').with_value('<SERVICE DEFAULT>')
|
||||
is_expected.to contain_oslo__middleware('gnocchi_config').with(
|
||||
:enable_proxy_headers_parsing => '<SERVICE DEFAULT>',
|
||||
:max_request_body_size => '<SERVICE DEFAULT>',
|
||||
)
|
||||
end
|
||||
|
||||
|
@ -165,6 +166,16 @@ describe 'gnocchi::api' do
|
|||
)}
|
||||
end
|
||||
|
||||
context 'with max_request_body_size' do
|
||||
before do
|
||||
params.merge!({:max_request_body_size => '102400' })
|
||||
end
|
||||
|
||||
it { is_expected.to contain_oslo__middleware('gnocchi_config').with(
|
||||
:max_request_body_size => '102400',
|
||||
)}
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
on_supported_os({
|
||||
|
|
Loading…
Reference in New Issue