]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/WwwStream.pm
www_stream: add response wrapper sub
[public-inbox.git] / lib / PublicInbox / WwwStream.pm
index d2bf318bed49a6027e68f7a696a91de1ff29de61..6de1b310da360bbbee5bcbd580b7d552bc2b8298 100644 (file)
@@ -14,6 +14,12 @@ sub new {
        bless { nr => 0, cb => $cb, ctx => $ctx }, $class;
 }
 
+sub response {
+       my ($class, $ctx, $code, $cb) = @_;
+       [ $code, [ 'Content-Type', 'text/html; charset=UTF-8' ],
+         $class->new($ctx, $cb) ]
+}
+
 sub _html_top ($) {
        my ($self) = @_;
        my $ctx = $self->{ctx};