Skip to content

Commit

Permalink
Fix force_download view
Browse files Browse the repository at this point in the history
  • Loading branch information
neoformit committed Jan 16, 2025
1 parent 7fa0e3e commit b51dab8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions app/labs/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,13 +115,13 @@ def force_download(self, request, relpath: Path, fname=None):
logger.debug('Serving file %s' % relpath)
response = serve(
request,
os.path.basename(relpath),
os.path.dirname(settings.TEMP_DIR / relpath)
relpath,
settings.INTERNAL_ROOT,
)
response['Content-Disposition'] = "attachment; filename=%s" % fname
return response

url = settings.INTERNAL_URL + str(relpath)
url = settings.INTERNAL_URL + str(relpath).strip('/')
logger.debug('Serving file via Nginx X-Accel-Redirect: %s' % relpath)
response = HttpResponse()
response['Content-Type'] = ''
Expand Down

0 comments on commit b51dab8

Please sign in to comment.