Setting headers in Perlbal

Mark Smith smitty at gmail.com
Fri Jun 20 18:19:43 UTC 2008


> Has anybody set response headers in perlbal ?
>
> Currently we're setting X-Served-By in the backend apaches to help
> troubleshoot, and would like to be able to identify which server
> served static content, which is done directly by perlbal.
>
> Anybody done this or something similar with a plugin, I suspect it
> would be a relatively simple patch to add a line to add the header to
> perlbal itself, but I'm trying to cut down on the number of
> site-specific patches ;)

Perlbal supports setting headers for the backends, but not for
responses.  That's kinda weird actually, I'd expect it to do both.
Oops.

Anyway, yes, it would be a really simple patch to add a header.
Perlbal::BackendHTTP::handle_response is probably the place to do it,
when it's constructing the headers.  Right where it says 'writing
response headers to client'.

But if you want to create a patch that adds the functionality for
munging response headers, based on the existing functionality, I'd be
happy to review and commit it!


-- 
Mark Smith / xb95
smitty at gmail.com


More information about the perlbal mailing list