Add flasktools.atom_response.

This commit is contained in:
voussoir 2022-11-11 11:38:29 -08:00
parent a06f51c49c
commit 1b7b506e20
No known key found for this signature in database
GPG key ID: 5F7554F8C26DACCB

View file

@ -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)