You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficcontrol.apache.org by dg...@apache.org on 2017/08/14 17:58:34 UTC

[2/4] incubator-trafficcontrol git commit: Add TO Whole-Content-SHA512 header

Add TO Whole-Content-SHA512 header


Project: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/commit/52638637
Tree: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/tree/52638637
Diff: http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/diff/52638637

Branch: refs/heads/master
Commit: 52638637c43cb94d78ad876712801f6399e2204e
Parents: 5c50e06
Author: Robert Butts <ro...@gmail.com>
Authored: Sat Aug 12 11:01:41 2017 -0600
Committer: Derek Gelinas <de...@cable.comcast.com>
Committed: Mon Aug 14 13:55:49 2017 -0400

----------------------------------------------------------------------
 traffic_ops/app/lib/TrafficOps.pm | 3 +++
 1 file changed, 3 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-trafficcontrol/blob/52638637/traffic_ops/app/lib/TrafficOps.pm
----------------------------------------------------------------------
diff --git a/traffic_ops/app/lib/TrafficOps.pm b/traffic_ops/app/lib/TrafficOps.pm
index c6bcf6c..897ee7a 100644
--- a/traffic_ops/app/lib/TrafficOps.pm
+++ b/traffic_ops/app/lib/TrafficOps.pm
@@ -48,6 +48,7 @@ use Utils::Helper::TrafficOpsRoutesLoader;
 use File::Path qw(make_path);
 use IO::Compress::Gzip 'gzip';
 use IO::Socket::SSL;
+use Digest::SHA qw(sha512_base64);
 
 use Utils::Helper::Version;
 
@@ -171,6 +172,8 @@ sub startup {
 		after_render => sub {
 			my ( $c, $output, $format ) = @_;
 
+			$c->res->headers->header('Whole-Content-SHA512' => sha512_base64($$output) . '==');
+
 			# Check if user agent accepts gzip compression
 			return unless ( $c->req->headers->accept_encoding // '' ) =~ /gzip/i;
 			$c->res->headers->append( Vary => 'Accept-Encoding' );