Skip to content

Commit

Permalink
added modify_response_headers hook
Browse files Browse the repository at this point in the history
  • Loading branch information
ddavis committed May 26, 2006
1 parent 421430b commit 153feec
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
6 changes: 6 additions & 0 deletions doc/hacking/hooks.txt
Expand Up @@ -92,6 +92,12 @@ Called when we're about to serve a local file, before we've done any
work. You can change the file served by modifying $uri_ref, and cancel the
process by returning a true value.

HANDLER modify_response_headers Perlbal::ClientHTTPBase
Called when we've set all the headers, and are about to serve a file.
You can change or add response headers at this point, or cancel the
process by returning a true value. You will have to send the response to
the client yourself if you do this.

HANDLER backend_response_received Perlbal::BackendHTTP
Called as soon as response headers are read from the backend. If you
return a true value, will stop all handling at that point.
Expand Down
2 changes: 2 additions & 0 deletions lib/Perlbal/ClientHTTPBase.pm
Expand Up @@ -403,6 +403,8 @@ sub _serve_request {

# has to happen after content-length is set to work:
$self->setup_keepalive($res);

return if $self->{service}->run_hook('modify_response_headers', $self);

if ($rm eq "HEAD" || $not_mod || $not_satisfiable) {
# we can return already, since we know the size
Expand Down

0 comments on commit 153feec

Please sign in to comment.