Changeset 108

Show
Ignore:
Timestamp:
01/27/10 00:59:18 (5 years ago)
Author:
jesus
Message:

Fixes #30 and updates to tests to make sure the output is the new expected behaviour

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/lib/Mungo/Response.pm

    r105 r108  
    451451    } 
    452452  } 
    453   $self->Flush(); 
     453  # If we have any data to write, or have written anything 
     454  # then the ball in our court. 
     455  # However, if we haven't, we should pass the status back 
     456  # from the main handler so that Apache ErrorDocs wil work. 
     457  if(($_r->{data}->{Buffer} && length($one_true_buffer)) || 
     458     $_r->{data}->{'__OUTPUT_STARTED__'}) { 
     459    $self->Flush(); 
     460  } 
     461  else { 
     462    $self->{Mungo}->{data}->{ApacheResponseCode} = $_r->{data}->{Status}; 
     463  } 
    454464  eval { goto  MUNGO_HANDLER_FINISH; }; # Jump back to Mungo::handler() 
    455465} 
  • trunk/t/11-redirect.t

    r96 r108  
    5050                                  label => "Page with text after redirect", 
    5151                                  status => 302, 
    52                                   initial_like => qr{^$}, 
     52                                  initial_like => qr{302 Found}, 
    5353                                  redirect_like => qr{^mungo-redirect-success$}, 
    5454                                 }, 
     
    5656                                           label => "Page with headers prior to redirect", 
    5757                                           status => 302, 
    58                                            initial_like => qr{^$}, 
     58                                           initial_like => qr{302 Found}, 
    5959                                           initial_header => [ 'X-mungo-test-header' => 'ponies' ], 
    6060                                           redirect_like => qr{^mungo-redirect-success$},