From 2ab3b45bf6435ffec986977345e457f11a45186b Mon Sep 17 00:00:00 2001 From: lian Date: Fri, 19 Jul 2019 20:37:05 +0800 Subject: [PATCH] add double quotes to Content-Disposition header (#3875) --- seahub/api2/endpoints/admin/statistics.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/seahub/api2/endpoints/admin/statistics.py b/seahub/api2/endpoints/admin/statistics.py index ff364836eb..dc42bcd506 100644 --- a/seahub/api2/endpoints/admin/statistics.py +++ b/seahub/api2/endpoints/admin/statistics.py @@ -248,7 +248,7 @@ class SystemUserTrafficExcelView(APIView): return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg) response = HttpResponse(content_type='application/ms-excel') - response['Content-Disposition'] = 'attachment; filename=%s.xlsx' % excel_name + response['Content-Disposition'] = 'attachment; filename="%s.xlsx"' % excel_name wb.save(response) return response @@ -293,7 +293,7 @@ class SystemUserStorageExcelView(APIView): return api_error(status.HTTP_500_INTERNAL_SERVER_ERROR, error_msg) response = HttpResponse(content_type='application/ms-excel') - response['Content-Disposition'] = 'attachment; filename=%s.xlsx' % excel_name + response['Content-Disposition'] = 'attachment; filename="%s.xlsx"' % excel_name wb.save(response) return response