CC: | Boris Zentner <bzm [...] 2bz.de> |
Subject: | [patch] add missing modify_response_headers hooks |
Hi,
this patch fix the following:
- adds two missing modify_response_headers hooks.
- add one missing server header
- keep setup_keepalive close to the content-length header
--
Boris
Subject: | missing_headers_and_hooks.diff |
diff -Nur a/Perlbal-1.72/lib/Perlbal/ClientHTTPBase.pm b/Perlbal-1.72/lib/Perlbal/ClientHTTPBase.pm
--- a/Perlbal-1.72/lib/Perlbal/ClientHTTPBase.pm 2008-09-14 02:23:38.000000000 +0200
+++ b/Perlbal-1.72/lib/Perlbal/ClientHTTPBase.pm 2008-10-21 20:29:01.000000000 +0200
@@ -712,6 +712,10 @@
$res->header("Content-Length", length($body));
$self->setup_keepalive($res);
+ $res->header('Server', 'Perlbal');
+
+ return if $self->{service}->run_hook('modify_response_headers', $self);
+
$self->state('xfer_resp');
$self->tcp_cork(1); # cork writes to self
$self->write($res->to_string_ref);
@@ -750,10 +754,12 @@
$res->header('Content-Length', length($body));
}
- $res->header('Server', 'Perlbal');
-
$self->setup_keepalive($res);
+ $res->header('Server', 'Perlbal');
+
+ return if $self->{service}->run_hook('modify_response_headers', $self);
+
$self->state('xfer_resp');
$self->tcp_cork(1); # cork writes to self
$self->write($res->to_string_ref);