Fix nginx pdf

This commit is contained in:
cuom1999 2022-08-31 10:44:33 -05:00
parent 66b9240fd4
commit 1c47d87b61

View file

@ -409,7 +409,7 @@ class ProblemPdfDescriptionView(ProblemMixin, SingleObjectMixin, View):
raise Http404()
response = HttpResponse()
if request.META.get("SERVER_SOFTWARE", "").startswith("nginx/"):
response["X-Accel-Redirect"] = problem.pdf_description
response["X-Accel-Redirect"] = problem.pdf_description.path
else:
with open(problem.pdf_description.path, "rb") as f:
response.content = f.read()