Skip to content

Commit

Permalink
Merge pull request #396 from jmcnatt/issue_395_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
root-expert authored Dec 3, 2021
2 parents 4278563 + a6df053 commit 6fb7fb9
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 10 deletions.
37 changes: 28 additions & 9 deletions spec/classes/jira_config_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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"}).
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion templates/server.xml.epp
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit 6fb7fb9

Please sign in to comment.