]> Sergey Matveev's repositories - public-inbox.git/blobdiff - lib/PublicInbox/Feed.pm
inbox: base_url method takes PSGI env hashref instead
[public-inbox.git] / lib / PublicInbox / Feed.pm
index c16c417a099e9e6b88bdc94e5f9897e37293380a..ffbf5c8062bb2121e2a0eeaca1dd517d7c8d01e6 100644 (file)
@@ -48,7 +48,7 @@ sub new_html {
        }
        $ctx->{-html_tip} = '<pre>';
        $ctx->{-upfx} = '';
-       my $res = PublicInbox::WwwStream->new($ctx, sub {
+       PublicInbox::WwwStream->response($ctx, 200, sub {
                while (my $path = shift @paths) {
                        my $m = do_cat_mail($ctx->{-inbox}, $path) or next;
                        my $more = scalar @paths;
@@ -58,7 +58,6 @@ sub new_html {
                }
                undef;
        });
-       [ 200, ['Content-Type', 'text/html; charset=UTF-8'], $res ]
 }
 
 # private subs
@@ -298,13 +297,11 @@ sub get_feedopts {
        my $pi_config = $ctx->{pi_config};
        my $inbox = $ctx->{inbox};
        my $obj = $ctx->{-inbox};
-       my $cgi = $ctx->{cgi};
        my %rv = ( description => $obj->description );
 
        $rv{address} = $obj->{address};
        $rv{id_addr} = $obj->{-primary_address};
-       my $url_base;
-       $url_base = $obj->base_url($cgi); # CGI may be undef
+       my $url_base = $obj->base_url($ctx->{env});
        if (my $mid = $ctx->{mid}) { # per-thread feed:
                $rv{atomurl} = "$url_base$mid/t.atom";
        } else {