Show
Ignore:
Timestamp:
05/28/09 16:25:36 (10 months ago)
Author:
ask
Message:

Make Redirect plugin more standards compliant

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/lib/Perlbal/Plugin/Redirect.pm

    r817 r819  
    1  
    21package Perlbal::Plugin::Redirect; 
    3  
    4 use Perlbal; 
    52use strict; 
    63use warnings; 
     
    2421        my $res_header = Perlbal::HTTPHeaders->new_response(301); 
    2522        $res_header->header('Location' => "http://$target_host$path"); 
     23        $res_header->header('Content-Length' => 0); 
     24        # really should only do the keep-alive for 1.1, but that's a bigger issue 
     25        $res_header->header('Connection' => 'keep-alive'); 
    2626        $pb->write($res_header->to_string_ref()); 
    27  
    28         # FIXME: Should probably generate a more interesting body here. 
    29         my $body = "..."; 
    30         $pb->write(\$body); 
    3127 
    3228        return 1;