+
+ # test custom output headers
+ $r->headers_out->set(X_Bender => 'kiss my shiny metal ass');
+ eval {
+ IO::CaptureOutput::capture(sub {$r->send_output}, \$stdout);
+ };
+ diag $@ if $@;
+
+ my $CL = 'Content-length: 12';
+ my $XB = 'X-bender: kiss my shiny metal ass';
+ my $nl = "\cM\cJ";
+ my $re = join $nl, "($CL$nl$XB)|($XB$nl$CL)",
+ 'Content-Type: text/plain; charset=iso8859-1',
+ '', 'Hello World!';
+ like($stdout, qr/$re/, '... prints output, including custom headers');