Андрей (andy) wrote in changelog,
Андрей
andy
changelog

[ljcom] r11504: LJSUP-11104 (prepare the new photo hosti...

Committer: ailyin
LJSUP-11104 (prepare the new photo hosting for deployment on servers in the US datacenter)
U   trunk/cgi-bin/LJ/Response/Binary.pm
U   trunk/cgi-bin/LJ/Response/Error.pm
U   trunk/cgi-bin/LJ/Response/JSON.pm
U   trunk/cgi-bin/LJ/Response/Redirect.pm
U   trunk/cgi-bin/LJ/Response/Template.pm
U   trunk/cgi-bin/LJ/Response.pm
Modified: trunk/cgi-bin/LJ/Response/Binary.pm
===================================================================
--- trunk/cgi-bin/LJ/Response/Binary.pm	2012-02-21 08:52:03 UTC (rev 11503)
+++ trunk/cgi-bin/LJ/Response/Binary.pm	2012-02-21 10:37:57 UTC (rev 11504)
@@ -9,6 +9,8 @@
 sub output {
     my ($self) = @_;
 
+    $self->output_http_headers;
+
     LJ::Request->content_type( $self->mimetype );
     LJ::Request->send_cookies;    
     LJ::Request->send_http_header();

Modified: trunk/cgi-bin/LJ/Response/Error.pm
===================================================================
--- trunk/cgi-bin/LJ/Response/Error.pm	2012-02-21 08:52:03 UTC (rev 11503)
+++ trunk/cgi-bin/LJ/Response/Error.pm	2012-02-21 10:37:57 UTC (rev 11504)
@@ -16,6 +16,8 @@
         'active_journal_username' => $self->active_journal_username,
     );
 
+    $self->output_http_headers;
+
     LJ::Request->notes( 'http_errors_no_bml' => 1 );
     LJ::Request->content_type('text/html; charset=utf-8');
     LJ::Request->send_cookies;    

Modified: trunk/cgi-bin/LJ/Response/JSON.pm
===================================================================
--- trunk/cgi-bin/LJ/Response/JSON.pm	2012-02-21 08:52:03 UTC (rev 11503)
+++ trunk/cgi-bin/LJ/Response/JSON.pm	2012-02-21 10:37:57 UTC (rev 11504)
@@ -12,6 +12,8 @@
 
     my $output = LJ::JSON->to_json( $self->data );
 
+    $self->output_http_headers;
+
     LJ::Request->content_type('application/json; charset=utf-8');
     LJ::Request->send_cookies;
     LJ::Request->send_http_header();

Modified: trunk/cgi-bin/LJ/Response/Redirect.pm
===================================================================
--- trunk/cgi-bin/LJ/Response/Redirect.pm	2012-02-21 08:52:03 UTC (rev 11503)
+++ trunk/cgi-bin/LJ/Response/Redirect.pm	2012-02-21 10:37:57 UTC (rev 11504)
@@ -9,6 +9,8 @@
 sub output {
     my ($self) = @_;
 
+    $self->output_http_headers;
+
     my $status;
     if ( $self->mode && $self->mode eq 'internal' ) {
         LJ::Request->header_out( 'X-Accel-Redirect' => $self->where );

Modified: trunk/cgi-bin/LJ/Response/Template.pm
===================================================================
--- trunk/cgi-bin/LJ/Response/Template.pm	2012-02-21 08:52:03 UTC (rev 11503)
+++ trunk/cgi-bin/LJ/Response/Template.pm	2012-02-21 10:37:57 UTC (rev 11504)
@@ -35,6 +35,8 @@
         $final_output = $output_body;
     }
 
+    $self->output_http_headers;
+
     LJ::Request->content_type('text/html; charset=utf-8');
     LJ::Request->send_cookies;    
     LJ::Request->send_http_header();

Modified: trunk/cgi-bin/LJ/Response.pm
===================================================================
--- trunk/cgi-bin/LJ/Response.pm	2012-02-21 08:52:03 UTC (rev 11503)
+++ trunk/cgi-bin/LJ/Response.pm	2012-02-21 10:37:57 UTC (rev 11504)
@@ -12,6 +12,8 @@
 use LJ::Response::Redirect;
 use LJ::Response::Template;
 
+__PACKAGE__->mk_accessors( qw( http_headers ) );
+
 sub new {
     my ( $class, %args ) = @_;
 
@@ -23,6 +25,15 @@
     # to output data
 }
 
+sub output_http_headers {
+    my ($self) = @_;
+
+    my $headers = $self->http_headers;
+    while ( my ( $key, $value ) = each %$headers ) {
+        LJ::Request->header_out( $key => $value );
+    }
+}
+
 sub http_status {
     return LJ::Request::OK;
 }

Tags: ailyin, andy, ljcom, pm
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