wisest owl (wisest_owl) wrote in changelog,
wisest owl
wisest_owl
changelog

[livejournal] r17427: Fix content-type header for userheads

Committer: gprochaev
Fix content-type header for userheads

U   trunk/cgi-bin/Apache/LiveJournal.pm
Modified: trunk/cgi-bin/Apache/LiveJournal.pm
===================================================================
--- trunk/cgi-bin/Apache/LiveJournal.pm	2010-09-22 03:16:19 UTC (rev 17426)
+++ trunk/cgi-bin/Apache/LiveJournal.pm	2010-09-22 06:50:23 UTC (rev 17427)
@@ -1423,7 +1423,10 @@
             LJ::Request->header_out('X-REPROXY-FILE', $paths->[0]);
         }
 
-        LJ::Request->content_type ($result->{mime_type});
+        my $mime_type = $result->{mime_type};
+        $mime_type ||= 'image/gif' if $uri =~ m|^/userhead/\d+|; ## default for userheads
+
+        LJ::Request->content_type ($mime_type);
         LJ::Request->header_out("Content-length", $size);
         LJ::Request->header_out("Cache-Control", "no-transform");
         LJ::Request->header_out("Last-Modified", LJ::TimeUtil->time_to_http ($result->{change_time}));

Tags: livejournal, pm, wisest-owl
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