You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Mojolicious version: 9.22 still works, 9.26, 9.31, 9.35 do not
Perl version: at least 5.34.0, 5.36.0, 5.38.0
Operating system: at least Ubuntu 22.4, MacOS 14.2.1
Steps to reproduce the behavior
Example code:
#! /usr/bin/env perl
use Mojolicious::Lite -signatures;
use Mojo::Collection;
get '/' => sub ($c) {
my $col = Mojo::Collection->new;
for (1..10000) {
push @$col, rand;
}
$c->render(data => $col->join("\n"));
};
app->start;
./mojo-bug get /
Expected behavior
It should produce 10000 lines of random numbers as the output.
Actual behavior
It first says "Mojo::Reactor::EV: I/O watcher failed: A response has already been rendered", then dies with inactivity timeout.
Analysis
IO::Compress::Gzip::gzip, which Mojolicious uses internally, accepts several different things as its input parameter, and Mojo::ByteStream is not one of those things.
I am unsure what the best solution would be, hence the bug report instead of a pull request. Possibilities:
in Mojo::Util::gzip, stringify $uncompressed first
in Mojolicious::Renderer::respond, check whether $output is a Mojo::ByteStream, and either stringify it or use $output->gzip directly, which would work
document that render() should not be fed Mojo::ByteStream (would violate principle of least astonishment)
something I did not think about
The text was updated successfully, but these errors were encountered:
Steps to reproduce the behavior
Example code:
./mojo-bug get /
Expected behavior
It should produce 10000 lines of random numbers as the output.
Actual behavior
It first says "Mojo::Reactor::EV: I/O watcher failed: A response has already been rendered", then dies with inactivity timeout.
Analysis
IO::Compress::Gzip::gzip, which Mojolicious uses internally, accepts several different things as its input parameter, and Mojo::ByteStream is not one of those things.
I am unsure what the best solution would be, hence the bug report instead of a pull request. Possibilities:
$uncompressed
first$output
is a Mojo::ByteStream, and either stringify it or use$output->gzip
directly, which would workrender()
should not be fed Mojo::ByteStream (would violate principle of least astonishment)The text was updated successfully, but these errors were encountered: