]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwStream.pm
www: allow html_oneshot to take an array arg
[public-inbox.git] / lib / PublicInbox / WwwStream.pm
index ab006c40509dc336a4c6bfa2a12fa5136a0131fd..f2777fdc64f8a33fdaa945db9f7eded819514dc2 100644 (file)
@@ -164,8 +164,8 @@ sub getline {
        $ctx->zflush(_html_end($ctx));
 }
 
-sub html_oneshot ($$;$) {
-       my ($ctx, $code, $sref) = @_;
+sub html_oneshot ($$;@) {
+       my ($ctx, $code) = @_[0, 1];
        my $res_hdr = [ 'Content-Type' => 'text/html; charset=UTF-8',
                'Content-Length' => undef ];
        bless $ctx, __PACKAGE__;
@@ -174,8 +174,7 @@ sub html_oneshot ($$;$) {
                $ctx->zmore(html_top($ctx));
                $ctx->{base_url} = base_url($ctx);
        };
-       $ctx->zmore($$sref) if $sref;
-       my $bdy = $ctx->zflush(_html_end($ctx));
+       my $bdy = $ctx->zflush(@_[2..$#_], _html_end($ctx));
        $res_hdr->[3] = length($bdy);
        [ $code, $res_hdr, [ $bdy ] ]
 }