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 glance will return a 413 Entity Too Large
and not log anything to glance.log.

Change-Id: If15f7cc9cef9a3bca855a3cd02068d45eedd171f
Closes-Bug: #1835161
This commit is contained in:
ZhongShengping 2019-07-04 11:34:42 +08:00
parent c5a4e73193
commit 643f342304
3 changed files with 21 additions and 0 deletions

View File

@ -240,6 +240,10 @@
# HTTPProxyToWSGI middleware.
# Defaults to $::os_service_default.
#
# [*max_request_body_size*]
# (Optional) Set max request body size
# Defaults to $::os_service_default.
#
# [*enable_v1_api*]
# (Optional) Enable or not Glance API v1.
# If you enable this option, you'll get a deprecation warning in Glance
@ -354,6 +358,7 @@ class glance::api(
$conversion_format = $::os_service_default,
$os_region_name = 'RegionOne',
$enable_proxy_headers_parsing = $::os_service_default,
$max_request_body_size = $::os_service_default,
$enable_v1_api = false,
$enable_v2_api = $::os_service_default,
$sync_db = true,
@ -542,6 +547,7 @@ class glance::api(
oslo::middleware { 'glance_api_config':
enable_proxy_headers_parsing => $enable_proxy_headers_parsing,
max_request_body_size => $max_request_body_size,
}
# SSL Options

View File

@ -0,0 +1,5 @@
---
features:
- |
Add support to configure `[oslo_middleware]/max_request_body_size` with
`$max_request_body_size`.

View File

@ -291,6 +291,16 @@ describe 'glance::api' do
)}
end
describe 'setting max_request_body_size' do
let :params do
default_params.merge({:max_request_body_size => '102400' })
end
it { is_expected.to contain_oslo__middleware('glance_api_config').with(
:max_request_body_size => '102400',
)}
end
describe 'with ssl options' do
let :params do
default_params.merge({