Explicit charset? when returning csv

This commit is contained in:
Анатолий Богомолов 2024-03-12 19:15:13 +10:00
parent 819aa6784f
commit 7d5a085294
1 changed files with 1 additions and 1 deletions

View File

@ -63,4 +63,4 @@ def export_users_to_csv(id: int):
writer.writeheader() writer.writeheader()
writer.writerows(map(lambda user: user.to_dict(), collection.users)) writer.writerows(map(lambda user: user.to_dict(), collection.users))
return si.getvalue(), 200, {'Content-Disposition': f'attachment; filename={filename}', 'Content-type': 'text/csv'} return si, 200, {'Content-Disposition': f'attachment; filename={filename}', 'Content-type': 'text/csv; charset=utf-8'}