vadvs (vadvs) wrote in changelog,
vadvs
vadvs
changelog

[livejournal] r17509: Add server watermark

Committer: vad
Add server watermark
U   trunk/cgi-bin/Apache/LiveJournal.pm
Modified: trunk/cgi-bin/Apache/LiveJournal.pm
===================================================================
--- trunk/cgi-bin/Apache/LiveJournal.pm	2010-10-05 09:19:22 UTC (rev 17508)
+++ trunk/cgi-bin/Apache/LiveJournal.pm	2010-10-05 09:46:29 UTC (rev 17509)
@@ -1780,7 +1780,8 @@
         $length = length($html);
         LJ::Request->header_out('Content-Encoding', 'gzip');
     }
-    #
+    
+    # other headers
     my $html_md5 = md5_base64($html);
     LJ::Request->header_out(ETag => $html_md5);
     LJ::Request->header_out('Content-MD5' => $html_md5);
@@ -1788,6 +1789,10 @@
     # Let caches know that Accept-Encoding will change content
     LJ::Request->header_out('Vary', 'Accept-Encoding, ETag');
 
+    # add server mark
+    my ($aws_id) = $LJ::HARDWARE_SERVER_NAME =~ /\-(.+)$/;
+    LJ::Request->header_out("X-AWS-Id" => $aws_id || 'unknown');
+
     LJ::Request->header_out("Content-length", $length);
     LJ::Request->send_http_header();
     LJ::Request->print($html) unless LJ::Request->header_only;

Tags: livejournal, pm, vadvs
Subscribe
  • Post a new comment

    Error

    Anonymous comments are disabled in this journal

    default userpic

    Your reply will be screened

    Your IP address will be recorded 

  • 0 comments