🐛 Fixed ascii-encoding in headers
This commit is contained in:
@@ -59,7 +59,7 @@ async def export_quiz(quiz_id: uuid.UUID, user: User = Depends(get_current_user)
|
||||
stream_response(),
|
||||
media_type="application/octet-stream",
|
||||
headers={
|
||||
"Content-Disposition": f"attachment;filename={quiz.title}.cqa"
|
||||
"Content-Disposition": f"attachment;filename={quiz.title.encode('ascii', errors='ignore').decode()}.cqa"
|
||||
# noqa: E501
|
||||
},
|
||||
)
|
||||
|
||||
@@ -270,6 +270,6 @@ async def export_quiz_answers(export_token: str, game_pin: str):
|
||||
iter_file(),
|
||||
media_type="application/vnd.ms-excel",
|
||||
headers={
|
||||
"Content-Disposition": f"attachment;filename=ClassQuiz-{quiz.title}-{datetime.now().strftime('%m-%d-%Y')}.xlsx" # noqa: E501
|
||||
"Content-Disposition": f"attachment;filename=ClassQuiz-{quiz.title.encode('ascii', errors='ignore').decode()}-{datetime.now().strftime('%m-%d-%Y')}.xlsx" # noqa: E501
|
||||
},
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user