From 648f589cc30684550c972d9cc4087e9e8b3fdc80 Mon Sep 17 00:00:00 2001 From: Andreas Thienemann Date: Thu, 16 Jul 2020 20:43:54 +0200 Subject: [PATCH] feat(redhat/apache-2.x.config.jinja): allow override of default_charset The current Red Hat config allows to set DefaultCharset to a value. In certain situations it is necessary to leave it unconfigured thouguh. Make the content optional, if the value of apache.default_charset is None, the item is skipped. Otherwise it defaults to UTF-8. --- apache/files/RedHat/apache-2.2.config.jinja | 6 +++++- apache/files/RedHat/apache-2.4.config.jinja | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/apache/files/RedHat/apache-2.2.config.jinja b/apache/files/RedHat/apache-2.2.config.jinja index 94e2680..c2bc11f 100644 --- a/apache/files/RedHat/apache-2.2.config.jinja +++ b/apache/files/RedHat/apache-2.2.config.jinja @@ -387,7 +387,11 @@ LogLevel warn # in HTML content to override this choice, comment out this # directive: # -AddDefaultCharset UTF-8 +{%- if apache.get('default_charset', False) is none %} +# AddDefaultCharset UTF-8 +{%- else %} +AddDefaultCharset {{ apache.get('default_charset', 'UTF-8') }} +{%- endif %} # diff --git a/apache/files/RedHat/apache-2.4.config.jinja b/apache/files/RedHat/apache-2.4.config.jinja index 556b90e..c5770da 100644 --- a/apache/files/RedHat/apache-2.4.config.jinja +++ b/apache/files/RedHat/apache-2.4.config.jinja @@ -348,7 +348,11 @@ LogLevel warn # in HTML content to override this choice, comment out this # directive: # -AddDefaultCharset {{ apache.default_charset }} +{%- if apache.get('default_charset', False) is none %} +# AddDefaultCharset UTF-8 +{%- else %} +AddDefaultCharset {{ apache.get('default_charset', 'UTF-8') }} +{%- endif %} #