Changeset 819

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

Make Redirect plugin more standards compliant

Location:
trunk
Files:
2 modified

Legend:

Unmodified
Added
Removed
  • trunk/CHANGES

    r813 r819  
     1    -- Make Redirect plugin more standards compliant (Ask BjÞrn Hansen) 
     2 
    13    -- Fix X-REPROXY-FILE to work with SSL connections (Greg Denton) 
    24 
     
    2022 
    2123    -- change the VHost plugin to treat 'www.example.com.' and 
    22        'www.example.com' the same. 
     24       'www.example.com' the same. (Ask) 
    2325 
    2426    -- silence warnings when things that look like variables on comment lines 
  • 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;