Skip to content

Commit

Permalink
#256 escape_uri_path
Browse files Browse the repository at this point in the history
  • Loading branch information
yn-coder committed Apr 20, 2021
1 parent 4ec39e7 commit e943feb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions project/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from django.http import HttpResponseForbidden, HttpResponse

from django.utils.html import strip_tags

from django.utils.encoding import escape_uri_path
from account.mixins import LoginRequiredMixin
from django.views.generic import View
from django.views.generic.edit import CreateView, UpdateView
Expand Down Expand Up @@ -520,12 +520,12 @@ def get(self, request, project_id):

# Set up the Http response.
filename = project_id + '_' + project.fullname + '.xlsx'

response = HttpResponse(
output,
content_type='application/vnd.openxmlformats-officedocument.spreadsheetml.sheet'
)
response['Content-Disposition'] = 'attachment; filename=%s' % filename

response['Content-Disposition'] = "attachment; filename=%s" % escape_uri_path(filename)
return response

def project_view_file_commit_view(request, project_id, rev_id):
Expand Down

0 comments on commit e943feb

Please sign in to comment.