The response no longer needs the context
[catagits/Catalyst-Runtime.git] / lib / Catalyst.pm
index 9bf4617..3a8e5c3 100644 (file)
@@ -2010,7 +2010,6 @@ sub prepare {
 
     # For on-demand data
     $c->request->_context($c);
-    $c->response->_context($c);
 
     #surely this is not the most efficient way to do things...
     $c->stats($class->stats_class->new)->enable($c->use_stats);
@@ -2027,8 +2026,6 @@ sub prepare {
             $c->prepare_request(@arguments);
             $c->prepare_connection;
             $c->prepare_query_parameters;
-            $c->prepare_headers;
-            $c->prepare_cookies;
             $c->prepare_path;
 
             # Prepare the body for reading, either by prepare_body
@@ -2120,25 +2117,11 @@ Prepares connection.
 
 sub prepare_connection {
     my $c = shift;
-    $c->request->prepare_connection;
+    # XXX - This is called on the engine (not the request) to maintain
+    #       Engine::PSGI back compat.
+    $c->engine->prepare_connection($c);
 }
 
-=head2 $c->prepare_cookies
-
-Prepares cookies.
-
-=cut
-
-sub prepare_cookies { my $c = shift; $c->engine->prepare_cookies( $c, @_ ) }
-
-=head2 $c->prepare_headers
-
-Prepares headers.
-
-=cut
-
-sub prepare_headers { my $c = shift; $c->engine->prepare_headers( $c, @_ ) }
-
 =head2 $c->prepare_parameters
 
 Prepares parameters.
@@ -2989,10 +2972,7 @@ your output data, if known.
 sub write {
     my $c = shift;
 
-    # Finalize headers if someone manually writes output
-    $c->finalize_headers;
-
-    return $c->engine->write( $c, @_ );
+    return $c->response->write( @_ );
 }
 
 =head2 version