Skip to content

Commit 6fb7fb9

Browse files
authored
Merge pull request #396 from jmcnatt/issue_395_fix
2 parents 4278563 + a6df053 commit 6fb7fb9

File tree

2 files changed

+29
-10
lines changed

2 files changed

+29
-10
lines changed

spec/classes/jira_config_spec.rb

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -503,29 +503,27 @@
503503

504504
it do
505505
is_expected.to contain_file(FILENAME_SERVER_XML).
506+
without_content(%r{scheme="http"}).
506507
with_content(%r{proxyName = 'www\.example\.com'}).
507508
with_content(%r{scheme = 'https'}).
508509
with_content(%r{proxyPort = '9999'})
509510
end
510511
end
511512

512-
context 'tomcat proxy path native ssl default params' do
513+
context 'tomcat native ssl default params' do
513514
let(:params) do
514515
super().merge(
515-
proxy: {
516-
'scheme' => 'https',
517-
'proxyName' => 'www.example.com',
518-
'proxyPort' => '9999'
519-
},
520516
tomcat_native_ssl: true
521517
)
522518
end
523519

524520
it do
525521
is_expected.to contain_file(FILENAME_SERVER_XML).
526-
with_content(%r{proxyName = 'www\.example\.com'}).
527-
with_content(%r{scheme = 'https'}).
528-
with_content(%r{proxyPort = '9999'}).
522+
with_content(%r{scheme="http"}).
523+
with_content(%r{scheme="https"}).
524+
without_content(%r{proxyName = 'www\.example\.com'}).
525+
without_content(%r{scheme = 'https'}).
526+
without_content(%r{proxyPort = '9999'}).
529527
with_content(%r{redirectPort="8443"}).
530528
with_content(%r{port="8443"}).
531529
with_content(%r{keyAlias="jira"}).
@@ -537,6 +535,27 @@
537535
end
538536
end
539537

538+
context 'tomcat native ssl default params with proxy path' do
539+
let(:params) do
540+
super().merge(
541+
proxy: {
542+
'scheme' => 'https',
543+
'proxyName' => 'www.example.com',
544+
'proxyPort' => '9999'
545+
},
546+
tomcat_native_ssl: true
547+
)
548+
end
549+
550+
it do
551+
is_expected.to contain_file(FILENAME_SERVER_XML).
552+
without_content(%r{scheme="http"}).
553+
with_content(%r{proxyName = 'www\.example\.com'}).
554+
with_content(%r{scheme = 'https'}).
555+
with_content(%r{proxyPort = '9999'})
556+
end
557+
end
558+
540559
context 'ajp proxy' do
541560
context 'with valid config including protocol AJP/1.3' do
542561
let(:params) do

templates/server.xml.epp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
enableLookups="<%= $jira::tomcat_enable_lookups %>"
7575
disableUploadTimeout="<%= $jira::tomcat_disable_upload_timeout %>"
7676
acceptCount="<%= $jira::tomcat_accept_count %>"
77-
<% if $jira::proxy['scheme'] { -%>
77+
<% if ! $jira::proxy['scheme'] { -%>
7878
scheme="https"
7979
<% } -%>
8080
secure="true"

0 commit comments

Comments
 (0)