From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: X-Spam-Status: No, score=-2.9 required=3.0 tests=ALL_TRUSTED,AWL,BAYES_00, T_RP_MATCHES_RCVD,URIBL_BLOCKED shortcircuit=no autolearn=unavailable version=3.3.2 X-Original-To: meta@public-inbox.org Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 40CC563385D for ; Thu, 3 Sep 2015 08:32:26 +0000 (UTC) From: Eric Wong To: meta@public-inbox.org Subject: [PATCH 2/3] feed: use application/atom+xml for Content-Type Date: Thu, 3 Sep 2015 08:32:25 +0000 Message-Id: <1441269146-2458-2-git-send-email-e@80x24.org> In-Reply-To: <1441269146-2458-1-git-send-email-e@80x24.org> References: <1441269146-2458-1-git-send-email-e@80x24.org> List-Id: This is the correct Content-Type for Atom feeds, especially since we updated to use ".atom" as the suffix. --- lib/PublicInbox/Feed.pm | 4 ++-- t/cgi.t | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/PublicInbox/Feed.pm b/lib/PublicInbox/Feed.pm index 2284f23..75fecf5 100644 --- a/lib/PublicInbox/Feed.pm +++ b/lib/PublicInbox/Feed.pm @@ -60,7 +60,7 @@ sub atom_header { sub emit_atom { my ($cb, $ctx) = @_; - my $fh = $cb->([ 200, ['Content-Type' => 'application/xml']]); + my $fh = $cb->([ 200, ['Content-Type' => 'application/atom+xml']]); my $max = $ctx->{max} || MAX_PER_PAGE; my $feed_opts = get_feedopts($ctx); my $x = atom_header($feed_opts); @@ -97,7 +97,7 @@ sub emit_atom_thread { my ($cb, $ctx) = @_; my $res = $ctx->{srch}->get_thread($ctx->{mid}); return _no_thread($cb) unless $res->{total}; - my $fh = $cb->([200, ['Content-Type' => 'application/xml']]); + my $fh = $cb->([200, ['Content-Type' => 'application/atom+xml']]); my $feed_opts = get_feedopts($ctx); my $html_url = $feed_opts->{atomurl} = $ctx->{self_url}; diff --git a/t/cgi.t b/t/cgi.t index b0af8ae..7f72eaa 100644 --- a/t/cgi.t +++ b/t/cgi.t @@ -206,7 +206,7 @@ EOF $path = "/test/blahblah%40example.com/t.atom"; $res = cgi_run($path); like($res->{head}, qr/^Status: 200 /, "atom returned 200"); - like($res->{head}, qr!^Content-Type: application/xml!m, + like($res->{head}, qr!^Content-Type: application/atom\+xml!m, "search returned atom"); my $p = XML::Feed->parse(\($res->{body})); is($p->format, "Atom", "parsed atom feed"); -- EW