Skip to content

Commit

Permalink
Clean up handlers has from response after data processing is done
Browse files Browse the repository at this point in the history
In most cases this should not leave any handlers on the object, but the
user might have injected a 'response_done' or 'response_redirect'
handler and we actually want those to stay around until those phases
arrives.
  • Loading branch information
gisle committed Jul 6, 2009
1 parent 0d2ffc5 commit 637f6c1
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions lib/LWP/Protocol.pm
Expand Up @@ -161,9 +161,12 @@ sub collect
}
}
};
if ($@) {
chomp($@);
$response->push_header('X-Died' => $@);
my $err = $@;
delete $response->{handlers}{response_data};
delete $response->{handlers} unless %{$response->{handlers}};
if ($err) {
chomp($err);
$response->push_header('X-Died' => $err);
$response->push_header("Client-Aborted", "die");
return $response;
}
Expand Down

0 comments on commit 637f6c1

Please sign in to comment.