Skip to content

Commit

Permalink
handle scalar refs content as well
Browse files Browse the repository at this point in the history
  • Loading branch information
xsawyerx committed Aug 28, 2011
1 parent ced8577 commit 3e50de8
Showing 1 changed file with 12 additions and 8 deletions.
20 changes: 12 additions & 8 deletions lib/Dancer.pm
Expand Up @@ -375,14 +375,18 @@ sub _send_file {
exists $options{'around_cb'}
and return $options{'around_cb'}->($content);

while ( my $line = <$content> ) {
exists $options{'before_cb'}
and $options{'before_cb'}->($line);

$writer->write($line);

exists $options{'after_cb'}
and $options{'after_cb'}->($line);
if ( ref $content ) {
while ( my $line = <$content> ) {
exists $options{'before_cb'}
and $options{'before_cb'}->($line);

$writer->write($line);

exists $options{'after_cb'}
and $options{'after_cb'}->($line);
}
} else {
$writer->write($content);
}
};
} );
Expand Down

0 comments on commit 3e50de8

Please sign in to comment.