]> Sergey Matveev's repositories - public-inbox.git/commitdiff
www_atom_stream: require 200 response
authorEric Wong <e@80x24.org>
Sat, 10 Sep 2022 08:16:55 +0000 (08:16 +0000)
committerEric Wong <e@80x24.org>
Sat, 10 Sep 2022 19:50:27 +0000 (19:50 +0000)
This simplifies parameter passing at the moment.  I can't
imagine an Atom feed reader would be parsing XML for 404s or
other error codes.

lib/PublicInbox/Feed.pm
lib/PublicInbox/SearchView.pm
lib/PublicInbox/WwwAtomStream.pm

index e0810420809e3eb8fce5216eff08e47c83a53add..bdfa0d9d904373c6f3af80908ccbf1e78af85e8d 100644 (file)
@@ -19,14 +19,14 @@ sub generate {
        my ($ctx) = @_;
        my $msgs = $ctx->{msgs} = recent_msgs($ctx);
        return _no_thread() unless @$msgs;
-       PublicInbox::WwwAtomStream->response($ctx, 200, \&generate_i);
+       PublicInbox::WwwAtomStream->response($ctx, \&generate_i);
 }
 
 sub generate_thread_atom {
        my ($ctx) = @_;
        my $msgs = $ctx->{msgs} = $ctx->{ibx}->over->get_thread($ctx->{mid});
        return _no_thread() unless @$msgs;
-       PublicInbox::WwwAtomStream->response($ctx, 200, \&generate_i);
+       PublicInbox::WwwAtomStream->response($ctx, \&generate_i);
 }
 
 sub generate_html_index {
index b025ec964b8060157e881272701ebd6a9dd94424..3dce768f78201347acc959240bfc88f75a9f5e85 100644 (file)
@@ -359,7 +359,7 @@ sub adump {
        my ($cb, $mset, $q, $ctx) = @_;
        $ctx->{ids} = $ctx->{ibx}->isrch->mset_to_artnums($mset);
        $ctx->{search_query} = $q; # used by WwwAtomStream::atom_header
-       PublicInbox::WwwAtomStream->response($ctx, 200, \&adump_i);
+       PublicInbox::WwwAtomStream->response($ctx, \&adump_i);
 }
 
 # callback for PublicInbox::WwwAtomStream::getline
index 09b6facbb337da0119ec063524a5dbd06373a323..906b292a703d1c14cf2e26bd9d844b13748168b5 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright (C) 2016-2021 all contributors <meta@public-inbox.org>
+# Copyright (C) all contributors <meta@public-inbox.org>
 # License: AGPL-3.0+ <https://www.gnu.org/licenses/agpl-3.0.txt>
 #
 # Atom body stream for HTTP responses
@@ -43,10 +43,10 @@ sub async_eml { # for async_blob_cb
 }
 
 sub response {
-       my ($class, $ctx, $code, $cb) = @_;
+       my ($class, $ctx, $cb) = @_;
        my $res_hdr = [ 'Content-Type' => 'application/atom+xml' ];
        $class->new($ctx, $cb);
-       $ctx->psgi_response($code, $res_hdr);
+       $ctx->psgi_response(200, $res_hdr);
 }
 
 # called once for each message by PSGI server