Coverage for rfpy/api/endpoints/reports/responses.py: 100%
6 statements
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-24 10:52 +0000
« prev ^ index » next coverage.py v7.8.0, created at 2025-04-24 10:52 +0000
1from webob import Response
4def attachment(content, content_type, filename):
5 """Create Response object representing an attachment"""
7 response = Response(content)
8 response.content_type = str(content_type)
9 response.content_disposition = str(
10 'attachment; filename="%s"' % filename.replace('"', '\\"')
11 )
13 return response