From: Tomohiro Hosaka Date: Wed, 16 Jan 2019 07:07:51 +0000 (+0900) Subject: even this change is appreciated. X-Git-Tag: v5.90124~10^2 X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=catagits%2FCatalyst-Runtime.git;a=commitdiff_plain;h=75a7c429032fcfea6805a0cfedcedabb656e9931 even this change is appreciated. --- diff --git a/lib/Catalyst/Response.pm b/lib/Catalyst/Response.pm index a9277b5..b0f04a3 100644 --- a/lib/Catalyst/Response.pm +++ b/lib/Catalyst/Response.pm @@ -196,7 +196,7 @@ sub from_psgi_response { die "You can't set a Catalyst response from that, expect a valid PSGI response"; } - return if $self->finalized_headers; + return unless $self->_context->has_encoding; # Encoding compatibilty. If the response set a charset, well... we need # to assume its properly encoded and NOT encode for this response. Otherwise diff --git a/t/psgi_utils.t b/t/psgi_utils.t index e5ab61c..923defb 100644 --- a/t/psgi_utils.t +++ b/t/psgi_utils.t @@ -73,6 +73,7 @@ my $psgi_app = sub { $writer->write("body"); $writer->close; }; + $c->clear_encoding; $c->res->from_psgi_response($psgi_app); }