Changed to die rather than set response redirection-security
Robert Rothenberg [Thu, 19 Jun 2014 16:40:39 +0000 (17:40 +0100)]
lib/Catalyst/Response.pm

index a3b65af..35432a0 100644 (file)
@@ -282,8 +282,8 @@ sub redirect {
         my $location = shift;
         my $status = shift || 302;
 
+        $self->location($location);
         $self->status($status);
-        $self->location($location);    # overwrites status if invalid
 
     }
 
@@ -300,9 +300,7 @@ around '_set_location' => sub {
 
         if ( $location =~ m/[\n\r]/ ) {    # check for header injection
 
-            $self->status(400);            # bad request
-
-            # TODO: warn about this or fail
+            die "blocking header injection";
 
         } else {