Enforce content type in CFN WSGI
This works around a bug in the config tools, not sending a type properly. Change-Id: I79b7b19d8c1af6cc34875fc05800dc9da5ac7cad Related-Bug: #1641589
This commit is contained in:
parent
16c2e5aa73
commit
f24b39c73a
@ -66,6 +66,9 @@
|
||||
# apache::vhost ssl parameters.
|
||||
# Optional. Default to apache::vhost 'ssl_*' defaults.
|
||||
#
|
||||
# [*vhost_custom_fragment*]
|
||||
# (optional) Additional vhost configuration, if applicable.
|
||||
#
|
||||
# == Dependencies
|
||||
#
|
||||
# requires Class['apache'] & Class['heat']
|
||||
@ -78,20 +81,21 @@
|
||||
#
|
||||
define heat::wsgi::apache (
|
||||
$port,
|
||||
$servername = $::fqdn,
|
||||
$bind_host = undef,
|
||||
$path = '/',
|
||||
$ssl = true,
|
||||
$workers = 1,
|
||||
$ssl_cert = undef,
|
||||
$ssl_key = undef,
|
||||
$ssl_chain = undef,
|
||||
$ssl_ca = undef,
|
||||
$ssl_crl_path = undef,
|
||||
$ssl_crl = undef,
|
||||
$ssl_certs_dir = undef,
|
||||
$threads = $::os_workers,
|
||||
$priority = '10',
|
||||
$servername = $::fqdn,
|
||||
$bind_host = undef,
|
||||
$path = '/',
|
||||
$ssl = true,
|
||||
$workers = 1,
|
||||
$ssl_cert = undef,
|
||||
$ssl_key = undef,
|
||||
$ssl_chain = undef,
|
||||
$ssl_ca = undef,
|
||||
$ssl_crl_path = undef,
|
||||
$ssl_crl = undef,
|
||||
$ssl_certs_dir = undef,
|
||||
$threads = $::os_workers,
|
||||
$priority = '10',
|
||||
$vhost_custom_fragment = undef,
|
||||
) {
|
||||
if $title !~ /^api(|_cfn|_cloudwatch)$/ {
|
||||
fail('The valid options are api, api_cfn, api_cloudwatch')
|
||||
@ -129,5 +133,6 @@ define heat::wsgi::apache (
|
||||
wsgi_script_source => getvar("::heat::params::heat_${title}_wsgi_script_source"),
|
||||
allow_encoded_slashes => 'on',
|
||||
require => Anchor['heat::install::end'],
|
||||
vhost_custom_fragment => $vhost_custom_fragment,
|
||||
}
|
||||
}
|
||||
|
@ -89,6 +89,10 @@ class heat::wsgi::apache_api_cfn (
|
||||
$priority = '10',
|
||||
) {
|
||||
|
||||
# See custom fragment below
|
||||
include ::apache
|
||||
include ::apache::mod::headers
|
||||
|
||||
validate_integer($port)
|
||||
|
||||
# Workaround for https://bugzilla.redhat.com/show_bug.cgi?id=1396553
|
||||
@ -99,21 +103,24 @@ class heat::wsgi::apache_api_cfn (
|
||||
notify => Heat::Wsgi::Apache['api_cfn'],
|
||||
}
|
||||
}
|
||||
|
||||
heat::wsgi::apache { 'api_cfn':
|
||||
port => $port,
|
||||
servername => $servername,
|
||||
bind_host => $bind_host,
|
||||
path => $path,
|
||||
ssl => $ssl,
|
||||
workers => $workers,
|
||||
ssl_cert => $ssl_cert,
|
||||
ssl_key => $ssl_key,
|
||||
ssl_chain => $ssl_chain,
|
||||
ssl_ca => $ssl_ca,
|
||||
ssl_crl_path => $ssl_crl_path,
|
||||
ssl_crl => $ssl_crl,
|
||||
ssl_certs_dir => $ssl_certs_dir,
|
||||
threads => $threads,
|
||||
priority => $priority,
|
||||
port => $port,
|
||||
servername => $servername,
|
||||
bind_host => $bind_host,
|
||||
path => $path,
|
||||
ssl => $ssl,
|
||||
workers => $workers,
|
||||
ssl_cert => $ssl_cert,
|
||||
ssl_key => $ssl_key,
|
||||
ssl_chain => $ssl_chain,
|
||||
ssl_ca => $ssl_ca,
|
||||
ssl_crl_path => $ssl_crl_path,
|
||||
ssl_crl => $ssl_crl,
|
||||
ssl_certs_dir => $ssl_certs_dir,
|
||||
threads => $threads,
|
||||
priority => $priority,
|
||||
# Enforce content-type, see https://bugs.launchpad.net/tripleo/+bug/1641589
|
||||
vhost_custom_fragment => 'RequestHeader set Content-Type "application/json"',
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user