summaryrefslogtreecommitdiffstats
path: root/config.cgi
diff options
context:
space:
mode:
authorFrédéric Buclin <LpSolit@gmail.com>2016-04-13 00:54:57 +0200
committerFrédéric Buclin <LpSolit@gmail.com>2016-04-13 00:54:57 +0200
commit4bd1de9fddf7b02e76184e8af3fe808037040285 (patch)
tree03f88a2991e506668a9fee189a94b6abd0d2ac41 /config.cgi
parent437d7e21a69a2a377f664d88e932a6f3d59270a3 (diff)
downloadbugzilla-4bd1de9fddf7b02e76184e8af3fe808037040285.tar.gz
bugzilla-4bd1de9fddf7b02e76184e8af3fe808037040285.tar.xz
Bug 398546 - config.cgi using the RDF format can generate a pretty large file
r=dkl
Diffstat (limited to 'config.cgi')
-rwxr-xr-xconfig.cgi3
1 files changed, 3 insertions, 0 deletions
diff --git a/config.cgi b/config.cgi
index 8e423ca00..3e3943989 100755
--- a/config.cgi
+++ b/config.cgi
@@ -139,6 +139,9 @@ sub display_data {
$template->process($format->{'template'}, $vars, \$output)
|| ThrowTemplateError($template->error());
+ # Remove leading whitespaces, to save some bandwidth.
+ $output =~ s/^\s+(?=<)//gm if $format->{'ctype'} =~ /rdf/;
+
# Wide characters cause md5_base64() to die.
my $digest_data = $output;
utf8::encode($digest_data) if utf8::is_utf8($digest_data);