Skip to content

Commit

Permalink
fix empty header-value handling
Browse files Browse the repository at this point in the history
  • Loading branch information
ansibleguy committed Jun 23, 2024
1 parent acbb146 commit db882ef
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% if site.headers | length > 0 %}
# site-specific headers
{% for header, value in site.headers.items() %}
{% if value not in NONE_VALUES %}
{% if value not in NONE_VALUES and value|default(none, true) is not none %}
{% if 'header' in header %}
{{ header }} {{ value }};
{% else %}
Expand Down
4 changes: 2 additions & 2 deletions templates/etc/nginx/sites-available/inc/site_https_headers.j2
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
{% if NGINX_CONFIG.headers | length > 0 %}
# global headers
{% for header, value in NGINX_CONFIG.headers.items() %}
{% if header not in site.headers and value not in NONE_VALUES %}
{% if header not in site.headers and value not in NONE_VALUES and value|default(none, true) is not none %}
{% if 'header' in header %}
{{ header }} {{ value }};
{% else %}
Expand All @@ -15,7 +15,7 @@
{% if site.headers | length > 0 %}
# site-specific headers
{% for header, value in site.headers.items() %}
{% if value not in NONE_VALUES %}
{% if value not in NONE_VALUES and value|default(none, true) is not none %}
{% if 'header' in header %}
{{ header }} {{ value }};
{% else %}
Expand Down

0 comments on commit db882ef

Please sign in to comment.