From 1b7b506e204a8a411ff5439c8f99044ab162492c Mon Sep 17 00:00:00 2001 From: Ethan Dalool Date: Fri, 11 Nov 2022 11:38:29 -0800 Subject: [PATCH] Add flasktools.atom_response. --- voussoirkit/flasktools.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/voussoirkit/flasktools.py b/voussoirkit/flasktools.py index 2ef7426..c674466 100644 --- a/voussoirkit/flasktools.py +++ b/voussoirkit/flasktools.py @@ -299,6 +299,11 @@ def gzip_response(request, response): return response +def atom_response(soup, *args, **kwargs): + response = flask.Response(str(soup), *args, **kwargs) + response.headers['Content-Type'] = 'application/atom+xml;charset=utf-8', + return response + def json_response(j, *args, **kwargs): dumped = json.dumps(j) response = flask.Response(dumped, *args, **kwargs)