$layer = ':raw';
}
- my $content = undef;
+ my $content = '';
my $handle = $self->fh;
binmode( $handle, $layer );
$handle->seek(0, IO::File::SEEK_SET);
- while ( $handle->sysread( my $buffer, 8192 ) ) {
- $content .= $buffer;
+
+ if ($layer eq ':raw') {
+ while ( $handle->sysread( my $buffer, 8192 ) ) {
+ $content .= $buffer;
+ }
+ }
+ else {
+ $content = do { local $/; $handle->getline };
}
$handle->seek(0, IO::File::SEEK_SET);
my ( $self, $layer ) = @_;
my $handle = $self->decoded_fh($layer);
- my $content = undef;
$handle->seek(0, IO::File::SEEK_SET);
- while ( $handle->sysread( my $buffer, 8192 ) ) {
- $content .= $buffer;
- }
+
+ my $content = do { local $/; $handle->getline };
$handle->seek(0, IO::File::SEEK_SET);
return $content;
is $res->content_charset, 'UTF-8';
}
-SKIP:
{
- skip 'skipped: sysread isn\'t allowed on :utf8 handles (starting with 5.029004)', 4 if $] >= '5.029004';
ok my $path = File::Spec->catfile('t', 'utf8.txt');
ok my $req = POST '/root/file_upload',
Content_Type => 'form-data',
is decode_utf8($res->content), "<p>This is stream_body_fh action ♥</p>\n";
}
-SKIP:
{
- skip 'skipped: sysread isn\'t allowed on :utf8 handles (starting with 5.029004)', 5 if $] >= '5.029004';
ok my $path = File::Spec->catfile('t', 'utf8.txt');
ok my $req = POST '/root/file_upload_utf8_param',
Content_Type => 'form-data',