Skip to content

Commit

Permalink
Quote filename in Content-Disposition (bug 540028)
Browse files Browse the repository at this point in the history
  • Loading branch information
yohanboniface committed Sep 9, 2014
1 parent acc8787 commit 43137c5
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions apps/versions/views.py
Expand Up @@ -129,7 +129,7 @@ def download_source(request, version_id):
viewer=True, ignore_disabled=True)
or acl.action_allowed(request, 'Editors', 'BinarySource'))):
res = HttpResponseSendFile(request, version.source.path)
name = os.path.basename(version.source.path)
res['Content-Disposition'] = "attachment; filename={0}".format(name)
name = os.path.basename(version.source.path.replace('"', ''))
res['Content-Disposition'] = 'attachment; filename="{0}"'.format(name)
return res
raise http.Http404()

0 comments on commit 43137c5

Please sign in to comment.