]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www_stream: aresponse assumes 200, too
authorEric Wong <e@80x24.org>
Sat, 10 Sep 2022 08:16:56 +0000 (08:16 +0000)
committerEric Wong <e@80x24.org>
Sat, 10 Sep 2022 19:50:28 +0000 (19:50 +0000)
There's no reason to be streaming large amounts of HTML for
anything other than a 200 response.

lib/PublicInbox/Feed.pm
lib/PublicInbox/SearchView.pm
lib/PublicInbox/View.pm
lib/PublicInbox/WwwStream.pm

index bdfa0d9d904373c6f3af80908ccbf1e78af85e8d..56ca98861a096365bd78402340f91078eb3ad85d 100644 (file)
@@ -71,7 +71,7 @@ sub new_html {
        $ctx->{-html_tip} = '<pre>';
        $ctx->{-upfx} = '';
        $ctx->{-hr} = 1;
-       PublicInbox::WwwStream::aresponse($ctx, 200, \&new_html_i);
+       PublicInbox::WwwStream::aresponse($ctx, \&new_html_i);
 }
 
 # private subs
index 3dce768f78201347acc959240bfc88f75a9f5e85..e0404e5fa5c724fb2a91eda9c60b171f8067682f 100644 (file)
@@ -325,7 +325,7 @@ sub mset_thread {
 
        @$msgs = reverse @$msgs if $r;
        $ctx->{msgs} = $msgs;
-       PublicInbox::WwwStream::aresponse($ctx, 200, \&mset_thread_i);
+       PublicInbox::WwwStream::aresponse($ctx, \&mset_thread_i);
 }
 
 # callback for PublicInbox::WwwStream::getline
index 033af283b587ae422cd79eeedcd6261b50837ddd..1cbc62bee5f29f7280d83b2a332a34d19eeb6a06 100644 (file)
@@ -80,7 +80,7 @@ sub msg_page {
        # allow user to easily browse the range around this message if
        # they have ->over
        $ctx->{-t_max} = $smsg->{ts};
-       PublicInbox::WwwStream::aresponse($ctx, 200, \&msg_page_i);
+       PublicInbox::WwwStream::aresponse($ctx, \&msg_page_i);
 }
 
 # /$INBOX/$MESSAGE_ID/#R
@@ -432,7 +432,7 @@ sub stream_thread_i { # PublicInbox::WwwStream::getline callback
 sub stream_thread ($$) {
        my ($rootset, $ctx) = @_;
        @{$ctx->{-queue}} = map { (0, $_) } @$rootset;
-       PublicInbox::WwwStream::aresponse($ctx, 200, \&stream_thread_i);
+       PublicInbox::WwwStream::aresponse($ctx, \&stream_thread_i);
 }
 
 # /$INBOX/$MSGID/t/ and /$INBOX/$MSGID/T/
@@ -483,7 +483,7 @@ EOF
        # flat display: lazy load the full message from smsg
        $ctx->{msgs} = $msgs;
        $ctx->{-html_tip} = '<pre>';
-       PublicInbox::WwwStream::aresponse($ctx, 200, \&thread_html_i);
+       PublicInbox::WwwStream::aresponse($ctx, \&thread_html_i);
 }
 
 sub thread_html_i { # PublicInbox::WwwStream::getline callback
index 115e04407f1c022624ee22040e6ea6c06a0b1fc7..1fc213d45f6b0457697ef1d7596e66b91e0d066b 100644 (file)
@@ -205,9 +205,9 @@ sub async_next ($) {
 }
 
 sub aresponse {
-       my ($ctx, $code, $cb) = @_;
+       my ($ctx, $cb) = @_;
        init($ctx, $cb);
-       $ctx->psgi_response($code, delete $ctx->{-res_hdr});
+       $ctx->psgi_response(200, delete $ctx->{-res_hdr});
 }
 
 sub html_init {