diff --git a/spec/classes/jira_config_spec.rb b/spec/classes/jira_config_spec.rb index 0436ef9d..3f909485 100644 --- a/spec/classes/jira_config_spec.rb +++ b/spec/classes/jira_config_spec.rb @@ -503,29 +503,27 @@ it do is_expected.to contain_file(FILENAME_SERVER_XML). + without_content(%r{scheme="http"}). with_content(%r{proxyName = 'www\.example\.com'}). with_content(%r{scheme = 'https'}). with_content(%r{proxyPort = '9999'}) end end - context 'tomcat proxy path native ssl default params' do + context 'tomcat native ssl default params' do let(:params) do super().merge( - proxy: { - 'scheme' => 'https', - 'proxyName' => 'www.example.com', - 'proxyPort' => '9999' - }, tomcat_native_ssl: true ) end it do is_expected.to contain_file(FILENAME_SERVER_XML). - with_content(%r{proxyName = 'www\.example\.com'}). - with_content(%r{scheme = 'https'}). - with_content(%r{proxyPort = '9999'}). + with_content(%r{scheme="http"}). + with_content(%r{scheme="https"}). + without_content(%r{proxyName = 'www\.example\.com'}). + without_content(%r{scheme = 'https'}). + without_content(%r{proxyPort = '9999'}). with_content(%r{redirectPort="8443"}). with_content(%r{port="8443"}). with_content(%r{keyAlias="jira"}). @@ -537,6 +535,27 @@ end end + context 'tomcat native ssl default params with proxy path' do + let(:params) do + super().merge( + proxy: { + 'scheme' => 'https', + 'proxyName' => 'www.example.com', + 'proxyPort' => '9999' + }, + tomcat_native_ssl: true + ) + end + + it do + is_expected.to contain_file(FILENAME_SERVER_XML). + without_content(%r{scheme="http"}). + with_content(%r{proxyName = 'www\.example\.com'}). + with_content(%r{scheme = 'https'}). + with_content(%r{proxyPort = '9999'}) + end + end + context 'ajp proxy' do context 'with valid config including protocol AJP/1.3' do let(:params) do diff --git a/templates/server.xml.epp b/templates/server.xml.epp index e096652a..a271964e 100644 --- a/templates/server.xml.epp +++ b/templates/server.xml.epp @@ -74,7 +74,7 @@ enableLookups="<%= $jira::tomcat_enable_lookups %>" disableUploadTimeout="<%= $jira::tomcat_disable_upload_timeout %>" acceptCount="<%= $jira::tomcat_accept_count %>" -<% if $jira::proxy['scheme'] { -%> +<% if ! $jira::proxy['scheme'] { -%> scheme="https" <% } -%> secure="true"