Use flasktools.atom_response.

This commit is contained in:
voussoir 2022-11-11 11:39:04 -08:00
parent e4b6e629c1
commit 732c13440e

View file

@ -483,14 +483,11 @@ def get_search_atom():
search = get_search_core() search = get_search_core()
soup = etiquette.helpers.make_atom_feed( soup = etiquette.helpers.make_atom_feed(
search.results, search.results,
feed_id=request.query_string.decode('utf-8'), feed_id='/search' + request.query_string.decode('utf-8'),
feed_title='etiquette search', feed_title='etiquette search',
feed_link=request.url.replace('/search.atom', '/search'), feed_link=request.url.replace('/search.atom', '/search'),
) )
outgoing_headers = { response = flasktools.atom_response(soup)
'Content-Type': 'application/atom+xml; charset=utf-8',
}
response = flask.Response(str(soup), headers=outgoing_headers)
return response return response
@site.route('/search.json') @site.route('/search.json')