When from_psgi_response, a bug when headers are already output and charset is set...
[catagits/Catalyst-Runtime.git] / lib / Catalyst / Response.pm
index 2399ae5..a9277b5 100644 (file)
@@ -196,6 +196,8 @@ sub from_psgi_response {
         die "You can't set a Catalyst response from that, expect a valid PSGI response";
     }
 
+    return if $self->finalized_headers;
+
     # Encoding compatibilty.   If the response set a charset, well... we need
     # to assume its properly encoded and NOT encode for this response.  Otherwise
     # We risk double encoding.