diff --git a/spec/defines/resource_server_spec.rb b/spec/defines/resource_server_spec.rb index f08f9c5ac..307a00861 100644 --- a/spec/defines/resource_server_spec.rb +++ b/spec/defines/resource_server_spec.rb @@ -1200,12 +1200,7 @@ end it 'has correctly ordered entries in the config' do - is_expected.to contain_concat__fragment("#{title}-header").with_content(%r{ - %r| - \s+add_header\s+header1 test value 1;\n - \s+add_header\s+header2 test value 2;\n - \s+add_header\s+header3 test value 3;\n - |}) + is_expected.to contain_concat__fragment("#{title}-header").with_content(%r{\s+add_header\s+"header1" "test value 1";\n\s+add_header\s+"header2" "test value 2";\n\s+add_header\s+"header3" "test value 3";\n}) end end @@ -1218,12 +1213,7 @@ end it 'has correctly ordered entries in the config' do - is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content(%r{ - %r| - \s+add_header\s+header1 test value 1;\n - \s+add_header\s+header2 test value 2;\n - \s+add_header\s+header3 test value 3;\n - |}) + is_expected.to contain_concat__fragment("#{title}-ssl-header").with_content(%r{\s+add_header\s+"header1" "test value 1";\n\s+add_header\s+"header2" "test value 2";\n\s+add_header\s+"header3" "test value 3";\n}) end end end diff --git a/templates/server/server_header.erb b/templates/server/server_header.erb index 8006a273e..6fda39e78 100644 --- a/templates/server/server_header.erb +++ b/templates/server/server_header.erb @@ -131,7 +131,7 @@ server { <% end -%> <% if @add_header -%> <%- @add_header.keys.sort.each do |key| -%> - add_header '<%= key %>' '<%= @add_header[key] %>'; + add_header "<%= key %>" "<%= @add_header[key] %>"; <%- end -%> <% end -%> <% if @maintenance -%> diff --git a/templates/server/server_ssl_header.erb b/templates/server/server_ssl_header.erb index fe8a01a0e..4bdb17885 100644 --- a/templates/server/server_ssl_header.erb +++ b/templates/server/server_ssl_header.erb @@ -161,6 +161,6 @@ server { <% end -%> <% if @add_header -%> <%- @add_header.keys.sort.each do |key| -%> - add_header '<%= key %>' '<%= @add_header[key] %>'; + add_header "<%= key %>" "<%= @add_header[key] %>"; <%- end -%> <% end -%>