-
-
Notifications
You must be signed in to change notification settings - Fork 881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow setting unquoted or custom flags on add_headers #1249
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,11 @@ | ||
<%- @add_header.keys.sort.each do |key| -%> | ||
<%- if @add_header[key] -%> | ||
<%- if @add_header[key].is_a?(Hash) -%> | ||
<%- @add_header[key].each do |sk, sv| -%> | ||
add_header "<%= key %>" <% if sk != '' %>"<%= sk %>"<% end %> <%= sv %>; | ||
<%- end -%> | ||
<%- else -%> | ||
add_header "<%= key %>" "<%= @add_header[key] %>"; | ||
<%- end -%> | ||
<%- end -%> | ||
<%- end -%> |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,7 +117,15 @@ server { | |
<% end -%> | ||
<% if @add_header -%> | ||
<%- @add_header.keys.sort.each do |key| -%> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we include the |
||
<%- if @add_header[key] -%> | ||
<%- if @add_header[key].is_a?(Hash) -%> | ||
<%- @add_header[key].each do |sk, sv| -%> | ||
add_header "<%= key %>" <% if sk != '' %>"<%= sk %>"<% end %> <%= sv %>; | ||
<%- end -%> | ||
<%- else -%> | ||
add_header "<%= key %>" "<%= @add_header[key] %>"; | ||
<%- end -%> | ||
<%- end -%> | ||
<%- end -%> | ||
<% end -%> | ||
<% if @maintenance -%> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -146,6 +146,14 @@ server { | |
<% end -%> | ||
<% if @add_header -%> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. With https://github.com/voxpupuli/puppet-nginx/pull/1255/files#diff-47715bb968540f5a31b0a368f867a413R159 we can lose this line without any loss of functionality. |
||
<%- @add_header.keys.sort.each do |key| -%> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And here |
||
<%- if @add_header[key] -%> | ||
<%- if @add_header[key].is_a?(Hash) -%> | ||
<%- @add_header[key].each do |sk, sv| -%> | ||
add_header "<%= key %>" <% if sk != '' %>"<%= sk %>"<% end %> <%= sv %>; | ||
<%- end -%> | ||
<%- else -%> | ||
add_header "<%= key %>" "<%= @add_header[key] %>"; | ||
<%- end -%> | ||
<%- end -%> | ||
<%- end -%> | ||
<% end -%> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do wonder if we should also rewrite this to
@add_header.sort.each do |header, value|
. I think that's the same but leads to cleaner code