return the proper atom and rss content types for the feeds

Signed-off-by: Brian S. Stephan <bss@incorporeal.org>
This commit is contained in:
2023-12-30 15:31:18 -06:00
parent 575e2ad387
commit 30d6f99c9b
2 changed files with 9 additions and 7 deletions

View File

@@ -14,7 +14,7 @@ import os
import re
from feedgen.feed import FeedGenerator
from flask import Blueprint, abort
from flask import Blueprint, Response, abort
from flask import current_app as app
from incorporealcms.lib import instance_resource_path_to_request_path, parse_md
@@ -61,9 +61,9 @@ def serve_feed(feed_type):
fe.content(content, type='html')
if feed_type == 'atom':
return fg.atom_str(pretty=True)
return Response(fg.atom_str(pretty=True), mimetype='application/atom+xml')
else:
return fg.rss_str(pretty=True)
return Response(fg.rss_str(pretty=True), mimetype='application/rss+xml')
def _generate_feed_id(feed_entry_path):