You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airavata.apache.org by ma...@apache.org on 2021/04/28 22:10:19 UTC

[airavata-django-portal] 01/02: AIRAVATA-3458 add gzip compression to file download

This is an automated email from the ASF dual-hosted git repository.

machristie pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/airavata-django-portal.git

commit 6444833560b40184cfc647170f6d9fb770fd7bb4
Author: Marcus Christie <ma...@apache.org>
AuthorDate: Tue Apr 27 18:27:21 2021 -0400

    AIRAVATA-3458 add gzip compression to file download
---
 django_airavata/apps/api/views.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/django_airavata/apps/api/views.py b/django_airavata/apps/api/views.py
index b2cd07b..12c363d 100644
--- a/django_airavata/apps/api/views.py
+++ b/django_airavata/apps/api/views.py
@@ -28,6 +28,7 @@ from airavata_django_portal_sdk import user_storage
 from django.conf import settings
 from django.core.exceptions import ObjectDoesNotExist, PermissionDenied
 from django.http import FileResponse, Http404, HttpResponse, JsonResponse
+from django.views.decorators.gzip import gzip_page
 from django.urls import reverse
 from rest_framework import mixins, status
 from rest_framework.decorators import action, api_view
@@ -1021,6 +1022,7 @@ def tus_upload_finish(request):
         return exceptions.generic_json_exception_response(e, status=400)
 
 
+@gzip_page
 @api_view()
 def download_file(request):
     # TODO check that user has access to this file using sharing API